https://pulumi.com logo
#general
Title
# general
n

nice-rain-32013

03/03/2023, 10:01 PM
Hello, I'm unable to deploy a stack currently, which was of course working fine before, getting the following error:
Copy code
panic: runtime error: index out of range [4] with length 1

goroutine 123 [running]:

<http://github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.parseRoleGrantsID({0x14000b98cc0|github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.parseRoleGrantsID({0x14000b98cc0>, 0x7})

	/home/runner/go/pkg/mod/github.com/!snowflake-!labs/terraform-provider-snowflake@v0.56.5/pkg/resources/role_grants.go:324 +0x2bc

<http://github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadRoleGrants(0x140005a6f00|github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadRoleGrants(0x140005a6f00>, {0x101adcc00?, 0x140009a09c0})

	/home/runner/go/pkg/mod/github.com/!snowflake-!labs/terraform-provider-snowflake@v0.56.5/pkg/resources/role_grants.go:110 +0xd8

...
<http://google.golang.org/grpc.(*Server).handleStream(0x14000972000|google.golang.org/grpc.(*Server).handleStream(0x14000972000>, {0x101b1ca80, 0x140006024e0}, 0x14000a79e60, 0x0)

	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:1713 +0x82c

<http://google.golang.org/grpc.(*Server).serveStreams.func1.2()|google.golang.org/grpc.(*Server).serveStreams.func1.2()>

	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:965 +0x84

created by <http://google.golang.org/grpc.(*Server).serveStreams.func1|google.golang.org/grpc.(*Server).serveStreams.func1>

	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.51.0/server.go:963 +0x290

error: error reading from server: EOF
error: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:58122: connect: connection refused"
error: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:58122: connect: connection refused"
is that something that rings a bell with anyone?
The problem seems to lie specifically with RoleGrants, and not on all machines; the same stack deployed on a different instance runs fine. I'm puzzled.
Checked with terraform, solved by using provider 0.58.0 (current version used by pulumi is 0.57.0, which crashes the same way with the same config from tf)
I tried changing .github/workflows/update-upstream-provider.yml to fix the error in https://github.com/pulumi/pulumi-snowflake/actions/runs/4328161830 but I get another error (gradle build)
Not familiar enough with this to make a useful PR 🙂
Latest release (0.18 pulls in the changes, thanks @ancient-policeman-24615 ) but now i get a different error, on all RoleGrants:
Copy code
~   ├─ snowflake:index:RoleGrants             AIRBYTE_ROLE                                                          refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             BACKEND_DEV                                                           refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             BACKEND_PROD                                                          refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             DBT_ROLE                                                              update      [diff: ~users]
 ~   ├─ snowflake:index:RoleGrants             BACKEND_INT                                                           refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             SYSADMIN                                                              refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             FIVETRAN_ROLE                                                         refresh     1 error
 ~   ├─ snowflake:index:RoleGrants             ACCOUNTADMIN                                                          refresh     1 error
 ~   └─ snowflake:index:RoleGrants             ANALYST                                                               refresh     1 error


Diagnostics:
  snowflake:index:RoleGrants (SYSADMIN):
    error: Preview failed: refreshing urn:pulumi:prod::snowflake::snowflake:index/roleGrants:RoleGrants::SYSADMIN: 1 error occurred:
    	* unexpected number of ID parts (1), expected 6

  snowflake:index:RoleGrants (FIVETRAN_ROLE):
    error: Preview failed: refreshing urn:pulumi:prod::snowflake::snowflake:index/roleGrants:RoleGrants::FIVETRAN_ROLE: 1 error occurred:
    	* unexpected number of ID parts (1), expected 6

  snowflake:index:RoleGrants (ACCOUNTADMIN):
    error: Preview failed: refreshing urn:pulumi:prod::snowflake::snowflake:index/roleGrants:RoleGrants::ACCOUNTADMIN: 1 error occurred:
    	* unexpected number of ID parts (1), expected 6

  snowflake:index:RoleGrants (BACKEND_INT):
    error: Preview failed: refreshing urn:pulumi:prod::snowflake::snowflake:index/roleGrants:RoleGrants::BACKEND_INT: 1 error occurred:
    	* unexpected number of ID parts (1), expected 6

  pulumi:pulumi:Stack (snowflake-prod):
    error: preview failed
m

melodic-car-16900

03/10/2023, 4:48 PM
Yes! What is this??
n

nice-rain-32013

03/10/2023, 4:48 PM
you get the same @melodic-car-16900?
m

melodic-car-16900

03/10/2023, 4:49 PM
I did, yes
I upgraded my various pulumi deps
n

nice-rain-32013

03/10/2023, 4:50 PM
at least I feel less alone 😄
m

melodic-car-16900

03/10/2023, 4:50 PM
To fix another problem
image.png
At least we're in the same time frame
n

nice-rain-32013

03/10/2023, 4:50 PM
classic 😉
m

melodic-car-16900

03/10/2023, 4:50 PM
So, I only get mine when I add --refresh to my pulumi up
is that the same for you?
n

nice-rain-32013

03/10/2023, 4:51 PM
no, same for all operations. at this point my snowflake stack is stuck in time. can't move on.
m

melodic-car-16900

03/10/2023, 4:51 PM
And I'm only getting it on the various grants: Table / Procedure / Sequence
ah, nightmare.
Copy code
snowflake:index:TableGrant (snowflake_tesco_uk_table_product_location_history_read_grant):
    error: Preview failed: refreshing urn:pulumi:non-pro::mast-snowflake::snowflake:index/tableGrant:TableGrant::snowflake_tesco_uk_table_product_location_history_read_grant: 1 error occurred:
    	* unexpected number of ID parts (1), expected 7

  snowflake:index:ProcedureGrant (snowflake_tesco_uk_procedure_load_product_main_grant):
    error: Preview failed: refreshing urn:pulumi:non-pro::mast-snowflake::snowflake:index/procedureGrant:ProcedureGrant::snowflake_tesco_uk_procedure_load_product_main_grant: 1 error occurred:
    	* unexpected number of ID parts (1), expected 8

  snowflake:index:SequenceGrant (snowflake_tesco_uk_table_store_store_id_sequence_usage_grant):
    error: Preview failed: refreshing urn:pulumi:non-pro::mast-snowflake::snowflake:index/sequenceGrant:SequenceGrant::snowflake_tesco_uk_table_store_store_id_sequence_usage_grant: 1 error occurred:
    	* unexpected number of ID parts (1), expected 6

  pulumi:pulumi:Stack (mast-snowflake-non-pro):
    error: preview failed

  snowflake:index:ProcedureGrant (snowflake_tesco_uk_procedure_load_product_location_history_grant):
    error: Preview failed: refreshing urn:pulumi:non-pro::mast-snowflake::snowflake:index/procedureGrant:ProcedureGrant::snowflake_tesco_uk_procedure_load_product_location_history_grant: 1 error occurred:
    	* unexpected number of ID parts (1), expected 8
n

nice-rain-32013

03/10/2023, 4:52 PM
looks borked indeed
i wonder if downgrading 2 versions back would work, haven't tested it but I think there were other issues that prompted me to upgrade
m

melodic-car-16900

03/10/2023, 4:54 PM
Yeah I was about to ask
n

nice-rain-32013

03/10/2023, 4:54 PM
i'll give it a shot on monday, enough for this week. will report here if i get around to it before someone at @echoing-match-29901 fixes that bug
m

melodic-car-16900

03/10/2023, 4:55 PM
Alright, I'm going to persevere for a while, I'll let you know what my resolution is
n

nice-rain-32013

03/10/2023, 4:55 PM
thanks heaps
m

melodic-car-16900

03/10/2023, 4:59 PM
Downgrading to what I came from, 0.14.0 doesn't look like it's worked, which frankly fills me with dread - I figure I might end up commenting out the grants -> delete -> uncomment -> recreate
idk
Oh wait, no, downgrading did work, I just had to run pulumi up without --refresh once, then rerunning with --refresh did work
let's try 0.16.0
Moving up to 0.16.0 was fine
0.16 -> 0.18 failed in the same way
am going to try 0.17
Copy code
snowflake:index:TableGrant (snowflake_tesco_uk_table_wsn_live_read_grant):
    error: Preview failed: error reading from server: EOF

  snowflake:index:Schema (snowflake_gelsons_source_schema):
    error: Preview failed: error reading from server: EOF

  snowflake:index:WarehouseGrant (snowflake_compute_warehouse_usage_grant):
    error: Preview failed: error reading from server: EOF

  snowflake:index:TableGrant (snowflake_tesco_uk_standard_table_product_select_grant):
    error: Preview failed: error reading from server: EOF

  snowflake:index:Table (snowflake_tesco_uk_table_store_store):
    error: Preview failed: error reading from server: EOF

  snowflake:index:Role (snowflake_role_write):
    error: Preview failed: error reading from server: EOF

  snowflake:index:SchemaGrant (snowflake_test_source_schema_grant):
    error: Preview failed: error reading from server: EOF

  snowflake:index:Procedure (snowflake_tesco_uk_procedure_load_product_main):
    error: Preview failed: error reading from server: EOF

  snowflake:index:SequenceGrant (snowflake_tesco_uk_table_product_main_id_sequence_usage_grant):
    error: Preview failed: error reading from server: EOF
Does something think that I'm DDOSing them or something?
Ok, 0.17.0 is failing is strange and unusual ways, I'm going to stick to 0.16.0 and call it a day
best of luck
n

nice-rain-32013

03/13/2023, 10:20 AM
no luck for me so far, now i get the same message even downgrading to 0.14!
the "unexpected number of ID parts (1), expected 6" one. All on RoleGrants
m

melodic-car-16900

03/13/2023, 3:54 PM
Do you get it when using pulumi up without --refresh>?
n

nice-rain-32013

03/13/2023, 4:05 PM
yes, makes no difference
m

melodic-car-16900

03/13/2023, 4:30 PM
That's upsetting
I feel for you
n

nice-rain-32013

03/14/2023, 11:32 AM
So. I simply deleted all the role grants with pulumi state delete --force and reran refresh and up, and everything works again -apparently- on 0.18. Case closed, i don't know, could be corruption of the state file when running under buggy 0.17? no idea, but problem gone.
m

melodic-car-16900

03/14/2023, 5:47 PM
--force
terrifies me. Luckily grants are something that can be nuked and recreated relatively easily I guess. Awesome, glad you sorted it out 👌
n

nice-rain-32013

03/15/2023, 9:53 AM
yes, the force shouldn't be used lightly 🙂
3 Views