infisical icon indicating copy to clipboard operation
infisical copied to clipboard

panic: runtime error: cannot convert slice with length 0 to pointer to array with length 32

Open jatm80 opened this issue 2 years ago • 3 comments

Today infisical cli started to throw this panic error in the CLI. it happens now with both version 0.3.1 and 0.3.5 , any idea what could this be? I am using infisical cloud.

INFO[0000] Debug logs enabled                           
DEBU[0000] GetAllEnvironmentVariables: Connected to internet, checking logged in creds 
DEBU[0000] FindWorkspaceConfigFile: workspace file found at [path=/home/path/project/.infisical.json] 
DEBU[0000] FindWorkspaceConfigFile: workspace file found at [path=/home/path/project/.infisical.json] 
DEBU[0001] GetAllEnvironmentVariables: Trying to fetch secrets using logged in details 
DEBU[0002] FindWorkspaceConfigFile: workspace file found at [path=/home/path/project/.infisical.json] 
panic: runtime error: cannot convert slice with length 0 to pointer to array with length 32

goroutine 1 [running]:
github.com/Infisical/infisical-merge/packages/crypto.DecryptAsymmetric(...)
	github.com/Infisical/infisical-merge/packages/crypto/crypto.go:79
github.com/Infisical/infisical-merge/packages/util.GetPlainTextSecretsViaJTW({0xc0000da370, 0xb0}, {0x0, 0x0}, {0xc0000dc618, 0x18}, {0x7ffe6dbfefe5, 0x4}, {0x0, 0x0})
	github.com/Infisical/infisical-merge/packages/util/secrets.go:83 +0x52b
github.com/Infisical/infisical-merge/packages/util.GetAllEnvironmentVariables({{0x7ffe6dbfefe5, 0x4}, 0x0, {0x0, 0x0}, {0x0, 0x0}})
	github.com/Infisical/infisical-merge/packages/util/secrets.go:140 +0x348
github.com/Infisical/infisical-merge/packages/cmd.glob..func10(0xd53040?, {0xc00027ea40, 0x1, 0x4})
	github.com/Infisical/infisical-merge/packages/cmd/run.go:85 +0x32c
github.com/spf13/cobra.(*Command).execute(0xd53040, {0xc00027ea00, 0x4, 0x4})
	github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xd52a80)
	github.com/spf13/[email protected]/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:968
github.com/Infisical/infisical-merge/packages/cmd.Execute()
	github.com/Infisical/infisical-merge/packages/cmd/root.go:26 +0x25
main.main()
	github.com/Infisical/infisical-merge/main.go:9 +0x17

jatm80 avatar Feb 28 '23 09:02 jatm80

@jatm80 Have you tried updating to the latest version of the CLI?

@maidul98 can help you out with this; he'll reply shortly! In the meantime feel free to join the Slack community here - It's often easier to communicate there in real-time :)

dangtony98 avatar Feb 28 '23 09:02 dangtony98

@jatm80 Have you tried updating to the latest version of the CLI?

@maidul98 can help you out with this; he'll reply shortly! In the meantime feel free to join the Slack community here - It's often easier to communicate there in real-time :)

Great, i will join slack tomorrow. and yes, this issue started happening today in version 0.3.5 (latest) and then i downgraded to 0.3.1 with the same result. The only thing different i did today from previous days, was to enable 2FA and upgrade to version 0.3.5 from 0.3.1.

jatm80 avatar Feb 28 '23 11:02 jatm80

Since you enabled 2FA, you will have to login again after upgrading to the latest version. Can you please update to the latest version and run the login command infisical login and then run the command which caused this error?

maidul98 avatar Feb 28 '23 13:02 maidul98

Since you enabled 2FA, you will have to login again after upgrading to the latest version. Can you please update to the latest version and run the login command infisical login and then run the command which caused this error?

Hi, @maidul98 , thanks for your reply, I upgraded to version 0.3.5, and after deleting the login file at ~/.infisical/ and the .infisical.json in my project and recreating them again using infisical login followed by infisical init the issue went away.

I noticed the content on ~/.infisical is different now after deleting and doing login again. Yesterday that was not the case, the content on that folder remained the same as of version 0.3.1.

For now it is good to close this ticket.

jatm80 avatar Mar 01 '23 09:03 jatm80