Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot register providers: Microsoft.TimeSeriesInsights #2439

Open
scottmack11 opened this issue Sep 24, 2024 · 14 comments
Open

Cannot register providers: Microsoft.TimeSeriesInsights #2439

scottmack11 opened this issue Sep 24, 2024 · 14 comments
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer

Comments

@scottmack11
Copy link

scottmack11 commented Sep 24, 2024

Describe what happened

Since yesterday we have been having issues with all of our pipelines throwing the error

Cannot register providers: Microsoft.TimeSeriesInsights

Seems its been deprecated and removed by Azure, Similar issue can be viewed over on the Terraform issues hashicorp/terraform-provider-azurerm#27466

We have tried upgrading Pulumi Azure to the latest version which should use mirror the fix seen on the Terraform issue by using the Azure Resource provider >= v3.90, however it does not fix the problem for us, it still attempts to register Microsoft.TimeSeriesInsights

Sample program

Any kind of pulumi preview/refresh/update against a pulumi stack using azurerm resource provider <= v3.89 will throw the error

Log output

Original Error: Cannot register providers: Microsoft.TimeSeriesInsights. Errors were: Cannot register provider Microsoft.TimeSeriesInsights with Azure Resource Manager: unexpected status 400 with error: DisallowedProvider: The operation is not permitted for namespace 'Microsoft.TimeSeriesInsights'. List of permitted provider namespaces is xxxxxxx

Affected Resource(s)

Provider Microsoft.TimeSeriesInsights

Output of pulumi about

CLI
Version 3.76.0
Go Version go1.20.6
Go Compiler gc

Plugins
NAME VERSION
azure 6.0.0
azuread 5.53.4
kubernetes 4.18.1
nodejs unknown
random 4.16.5

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@scottmack11 scottmack11 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 24, 2024
@mpp-paulj
Copy link

I'm also having this issue, be great so help/share with me too please (Y)

@mikhailshilkov
Copy link
Member

Reading the upstream issue, it sounds like pulumi-azure versions 5.65.0 or later should not have this problem.

@scottmack11 @mpp-paulj To double check - are you still having this issue with the latest version of the provider? Does it occur on a fresh stack/project?

@scottmack11
Copy link
Author

Reading the upstream issue, it sounds like pulumi-azure versions 5.65.0 or later should not have this problem.

@scottmack11 @mpp-paulj To double check - are you still having this issue with the latest version of the provider? Does it occur on a fresh stack/project?

Im having this issue with existing stacks on version 5.57.0 but attempting to upgrade and move to version 6.0.0. I havent tried a fresh stack but will come back with results when I have attempted to do so.

@mikhailshilkov
Copy link
Member

I tested locally on a clean project and 5.64.0 fails for me while 5.65.0 works. I was also able to migrate from a stack that has 5.64.0 in its state (had to edit it manually) to 6.0.0. Looking forward to other experience reports.

@scottmack11
Copy link
Author

I tested locally on a clean project and 5.64.0 fails for me while 5.65.0 works. I was also able to migrate from a stack that has 5.64.0 in its state (had to edit it manually) to 6.0.0. Looking forward to other experience reports.

Can confirm works fine from 6.0.0 directly its just the upgrade path

What did you need to manually edit in state to get this to work? Its painful having hundreds of stacks, but may be the quickest solution for me.

@mpp-paulj
Copy link

I tested locally on a clean project and 5.64.0 fails for me while 5.65.0 works. I was also able to migrate from a stack that has 5.64.0 in its state (had to edit it manually) to 6.0.0. Looking forward to other experience reports.

Yes this is also the issue for me, trying to get the stack updated to the latest.

@mikhailshilkov mikhailshilkov added the p1 A bug severe enough to be the next item assigned to an engineer label Sep 24, 2024
@mikhailshilkov
Copy link
Member

@scottmack11 @mpp-paulj What is the exact command that you run after upgrading the SDK version? Any chance you run a refresh or a delete that are still on the old version of the provider?

@scottmack11
Copy link
Author

scottmack11 commented Sep 24, 2024

So the first command my pipelines usually run when we are deploying is

npm install
pulumi refresh -y --skip-preview --suppress-outputs --non-interactive

For the sake of testing I have also pulled it all down locally and tried running all combinations of pulumi refresh/preview/up

Both versions, 5.57.0 (My old version) and 6.0.0 (What im upgrading to) throw the same error as is in the original post with all three pulumi commands.

I have also tried the flags
azure:skipProviderRegistration: "true"

and azure:resourceProviderRegistrations: "none" in config

But the issue persists, I was hoping that would at least let me get to the point I could refresh on the new package then turn it off but I get the same errors

@mikhailshilkov
Copy link
Member

@scottmack11 pulumi refresh (or pulumi up --refresh or pulumi preview --refresh) run the old version of the provider from the state, not the new version from your package configuration. You'd need to run a pulumi up command successfully to override the versions in your state file before you can refresh.

@thomas11
Copy link
Contributor

Here's a complete sequence of commands that I just tried out. To start with, since it's not possible anymore to create a new project on 5.64, I created a minimal project with one resource group on 5.65. Then, I hand-edited the stack, replacing all occurrences of 5.65 and 5_65 with 5.64/5_64.

Then:

> yarn add @pulumi/azure@5.64.0
[...]
info All dependencies
└─ @pulumi/azure@5.64.0
✨  Done in 4.33s.


> pulumi up -s dev
Previewing update (dev):
     Type                         Name                    Plan     Info
     pulumi:pulumi:Stack          azure-2439-upgrade-dev
     └─ azure:core:ResourceGroup  resourceGroup                    1 error

Diagnostics:
  azure:core:ResourceGroup (resourceGroup):
    error: 1 error occurred:
    	* Error ensuring Resource Providers are registered.
  [...]
    Original Error: Cannot register providers: Microsoft.TimeSeriesInsights. [...]


> pulumi stack export
{
    "version": 3,
    "deployment": {
        [...]
        "resources": [
            {
                "urn": "urn:pulumi:dev::azure-2439-upgrade::pulumi:providers:azure::default_5_64_0",
                "custom": true,
                "id": "104e1cbe-e119-488b-96fc-bd7327e93bc7",
                "type": "pulumi:providers:azure",
                "inputs": {
                    "__internal": {},
                    "version": "5.64.0"
                },
                "outputs": {
                    "version": "5.64.0"
                },
                "created": "2024-09-24T15:47:53.337195Z",
                "modified": "2024-09-24T15:47:53.337195Z"
            },
            [...]
        ]
    }
}


> yarn add @pulumi/azure@5.65.0
[...]
info All dependencies
└─ @pulumi/azure@5.65.0
✨  Done in 1.41s.


> pulumi up -s dev
Previewing update (dev):
     Type                 Name                    Plan
     pulumi:pulumi:Stack  azure-2439-upgrade-dev

Resources:
    2 unchanged

Do you want to perform this update? yes
Updating (dev):
     Type                 Name                    Status
     pulumi:pulumi:Stack  azure-2439-upgrade-dev

Resources:
    2 unchanged

Duration: 8s


> pulumi stack export
{
    "version": 3,
    "deployment": {
        [...]
        "resources": [
            {
                "urn": "urn:pulumi:dev::azure-2439-upgrade::pulumi:providers:azure::default_5_65_0",
                "custom": true,
                "id": "0f9a7296-782a-4d32-9ec9-8537b940fb2b",
                "type": "pulumi:providers:azure",
                "inputs": {
                    "__internal": {},
                    "version": "5.65.0"
                },
                "outputs": {
                    "version": "5.65.0"
                },
                "created": "2024-09-24T15:53:58.537993Z",
                "modified": "2024-09-24T15:53:58.537993Z"
            },
            [...]
       ]
    }
}

@scottmack11
Copy link
Author

Here's a complete sequence of commands that I just tried out. To start with, since it's not possible anymore to create a new project on 5.64, I created a minimal project with one resource group on 5.65. Then, I hand-edited the stack, replacing all occurrences of 5.65 and 5_65 with 5.64/5_64.

Then:

> yarn add @pulumi/azure@5.64.0
[...]
info All dependencies
└─ @pulumi/azure@5.64.0
✨  Done in 4.33s.


> pulumi up -s dev
Previewing update (dev):
     Type                         Name                    Plan     Info
     pulumi:pulumi:Stack          azure-2439-upgrade-dev
     └─ azure:core:ResourceGroup  resourceGroup                    1 error

Diagnostics:
  azure:core:ResourceGroup (resourceGroup):
    error: 1 error occurred:
    	* Error ensuring Resource Providers are registered.
  [...]
    Original Error: Cannot register providers: Microsoft.TimeSeriesInsights. [...]


> pulumi stack export
{
    "version": 3,
    "deployment": {
        [...]
        "resources": [
            {
                "urn": "urn:pulumi:dev::azure-2439-upgrade::pulumi:providers:azure::default_5_64_0",
                "custom": true,
                "id": "104e1cbe-e119-488b-96fc-bd7327e93bc7",
                "type": "pulumi:providers:azure",
                "inputs": {
                    "__internal": {},
                    "version": "5.64.0"
                },
                "outputs": {
                    "version": "5.64.0"
                },
                "created": "2024-09-24T15:47:53.337195Z",
                "modified": "2024-09-24T15:47:53.337195Z"
            },
            [...]
        ]
    }
}


> yarn add @pulumi/azure@5.65.0
[...]
info All dependencies
└─ @pulumi/azure@5.65.0
✨  Done in 1.41s.


> pulumi up -s dev
Previewing update (dev):
     Type                 Name                    Plan
     pulumi:pulumi:Stack  azure-2439-upgrade-dev

Resources:
    2 unchanged

Do you want to perform this update? yes
Updating (dev):
     Type                 Name                    Status
     pulumi:pulumi:Stack  azure-2439-upgrade-dev

Resources:
    2 unchanged

Duration: 8s


> pulumi stack export
{
    "version": 3,
    "deployment": {
        [...]
        "resources": [
            {
                "urn": "urn:pulumi:dev::azure-2439-upgrade::pulumi:providers:azure::default_5_65_0",
                "custom": true,
                "id": "0f9a7296-782a-4d32-9ec9-8537b940fb2b",
                "type": "pulumi:providers:azure",
                "inputs": {
                    "__internal": {},
                    "version": "5.65.0"
                },
                "outputs": {
                    "version": "5.65.0"
                },
                "created": "2024-09-24T15:53:58.537993Z",
                "modified": "2024-09-24T15:53:58.537993Z"
            },
            [...]
       ]
    }
}

Ah I see my mistake, im going to give this a try tomorrow when im back in work will post results

@scottmack11
Copy link
Author

Just FYI anybody reading this with the same issue, the above post by @thomas11 has given me a path to migrate

@danielrbradley danielrbradley removed the needs-triage Needs attention from the triage team label Sep 27, 2024
@amsreinhardt
Copy link

amsreinhardt commented Sep 27, 2024

I get this error with latest 5.x, with 6.0 and also with 6.1 alpha. None work with my existing project.
It fails on Redis:
azure:redis:Cache (redis):

@mikhailshilkov
Copy link
Member

@amsreinhardt Your Redis error looks incomplete? What is the command that you are running? We are fairly sure that this error comes only from old provider versions - what you see is likely that the old provider version is still executed from resources that are in your state file. You either need to upgrade them with a pulumi up command without refresh or delete operations, or edit your state file as explained above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer
Projects
None yet
Development

No branches or pull requests

6 participants