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

panic: runtime error: invalid memory address or nil pointer dereference #76

Closed
joshstrange opened this issue Apr 10, 2024 · 4 comments
Closed

Comments

@joshstrange
Copy link

This is almost 100% my fault. I signed in with my email (josh@ my username .com) then ctrl-c'd out because I wanted to use a different email address, for my business, before changing my mind again and using my personal account. I wiped the .plandex-home directory since I was already logged in and re-installed (which recreated the directory) but I keep getting this error.

josh@MacBook-Pro frontend % plandex new
? 👋 Hey there!
It looks like this is your first time using Plandex on this computer.
What would you like to do? Sign in, accept an invite, or create an account
? Use Plandex Cloud or another host? Plandex Cloud
✔ Your email: … <REMOVED>
✉️  You'll now receive a 6 character pin by email. It will be valid for 5 minutes.
✔ Please enter your pin: … ******
🧐 You don't have access to any orgs yet.

To join an existing org, ask an admin to either invite you directly or give your whole email domain access.

Otherwise, you can go ahead and create a new org.
Create a new org now? (y)es | (n)o> y
✔ Org name: … <removed>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x1009544d4]

goroutine 1 [running]:
plandex/auth.createOrg()
	/Users/ds/projects/plandex/app/cli/auth/org.go:67 +0x84
plandex/auth.promptNoOrgs()
	/Users/ds/projects/plandex/app/cli/auth/org.go:55 +0xc4
plandex/auth.resolveOrgAuth({0x0?, 0x14000028288?, 0x14?})
	/Users/ds/projects/plandex/app/cli/auth/org.go:16 +0x98
plandex/auth.signIn({0x14000028288, 0x14}, {0x1400000f110, 0x6}, {0x0, 0x0})
	/Users/ds/projects/plandex/app/cli/auth/account.go:217 +0x9c
plandex/auth.promptSignInNewAccount()
	/Users/ds/projects/plandex/app/cli/auth/account.go:178 +0x278
plandex/auth.SelectOrSignInOrCreate()
	/Users/ds/projects/plandex/app/cli/auth/account.go:53 +0x38
plandex/auth.promptInitialAuth()
	/Users/ds/projects/plandex/app/cli/auth/account.go:33 +0x124
plandex/auth.MustResolveAuth(0x1)
	/Users/ds/projects/plandex/app/cli/auth/auth.go:26 +0x330
plandex/auth.MustResolveAuthWithOrg(...)
	/Users/ds/projects/plandex/app/cli/auth/auth.go:13
plandex/cmd.new(0x1400050a900?, {0x10138c440?, 0x4?, 0x1009df147?})
	/Users/ds/projects/plandex/app/cli/cmd/new.go:35 +0x2c
github.com/spf13/cobra.(*Command).execute(0x101331dc0, {0x10138c440, 0x0, 0x0})
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x814
github.com/spf13/cobra.(*Command).ExecuteC(0x101332f00)
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
plandex/cmd.Execute()
	/Users/ds/projects/plandex/app/cli/cmd/root.go:23 +0x24
main.main()
	/Users/ds/projects/plandex/app/cli/main.go:55 +0x90

Related, trying to switch to the plan an anonymous account is now giving me this:

josh@MacBook-Pro frontend % plandex new
? 👋 Hey there!
It looks like this is your first time using Plandex on this computer.
What would you like to do? Start an anonymous trial on Plandex Cloud (no email required)
🚨 Error creating plan
  → Project does not exist in org
josh@MacBook-Pro frontend % plandex new
🚨 Error creating plan
  → Project does not exist in org

I assume there is some other config I need to delete to do a full "reset". It was working at one point (anon account) but I deleted the home folder so I could login (I hit enter by accident when setting it up again, yeah, I'm batting 1000 today...) and now I can't get back to that working-anon state either.

Sorry, this is 100% user-error.

@danenania
Copy link
Contributor

Sorry about that! It should definitely recover smoothly after a ctrl+c rather than failing like that.

You can reset fully with rm -rf $HOME/.plandex-home and rm -rf .plandex from the current directory, then run plandex new again.

@danenania
Copy link
Contributor

If you're still having any issues, let me know and I can remove your account from the cloud as well in order to give you a totally fresh start.

@joshstrange
Copy link
Author

I tried removing both the home directory and product directory files but I still get this error when entering my org name. I think my org name is burned somehow (joshstrange). I used a different name and now it's working. Thank you!

josh@MacBook-Pro frontend % plandex new
? 👋 Hey there!
It looks like this is your first time using Plandex on this computer.
What would you like to do? Sign in, accept an invite, or create an account
? Use Plandex Cloud or another host? Plandex Cloud
✔ Your email: … <REMOVED>
✉️  You'll now receive a 6 character pin by email. It will be valid for 5 minutes.
✔ Please enter your pin: … ******
🧐 You don't have access to any orgs yet.

To join an existing org, ask an admin to either invite you directly or give your whole email domain access.

Otherwise, you can go ahead and create a new org.
Create a new org now? (y)es | (n)o> y
✔ Org name: … <REMOVED>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x1009b04d4]

goroutine 1 [running]:
plandex/auth.createOrg()
	/Users/ds/projects/plandex/app/cli/auth/org.go:67 +0x84
plandex/auth.promptNoOrgs()
	/Users/ds/projects/plandex/app/cli/auth/org.go:55 +0xc4
plandex/auth.resolveOrgAuth({0x0?, 0x140000a2378?, 0x14?})
	/Users/ds/projects/plandex/app/cli/auth/org.go:16 +0x98
plandex/auth.signIn({0x140000a2378, 0x14}, {0x14000399770, 0x6}, {0x0, 0x0})
	/Users/ds/projects/plandex/app/cli/auth/account.go:217 +0x9c
plandex/auth.promptSignInNewAccount()
	/Users/ds/projects/plandex/app/cli/auth/account.go:178 +0x278
plandex/auth.SelectOrSignInOrCreate()
	/Users/ds/projects/plandex/app/cli/auth/account.go:53 +0x38
plandex/auth.promptInitialAuth()
	/Users/ds/projects/plandex/app/cli/auth/account.go:33 +0x124
plandex/auth.MustResolveAuth(0x1)
	/Users/ds/projects/plandex/app/cli/auth/auth.go:26 +0x330
plandex/auth.MustResolveAuthWithOrg(...)
	/Users/ds/projects/plandex/app/cli/auth/auth.go:13
plandex/cmd.new(0x14000112800?, {0x1013e8440?, 0x4?, 0x100a3b147?})
	/Users/ds/projects/plandex/app/cli/cmd/new.go:35 +0x2c
github.com/spf13/cobra.(*Command).execute(0x10138ddc0, {0x1013e8440, 0x0, 0x0})
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x814
github.com/spf13/cobra.(*Command).ExecuteC(0x10138ef00)
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/ds/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
plandex/cmd.Execute()
	/Users/ds/projects/plandex/app/cli/cmd/root.go:23 +0x24
main.main()
	/Users/ds/projects/plandex/app/cli/main.go:55 +0x90

@danenania
Copy link
Contributor

Ok strange about the org name, will investigate that. Glad to hear it's working for you now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants