phrase / phrase-cli

CLI for the Phrase API
https://developers.phrase.com
MIT License
42 stars 6 forks source link

Phrase is not able to pull translations, due to an error saying `FORBIDDEN`. #99

Closed mrhahn3000 closed 2 years ago

mrhahn3000 commented 2 years ago

Phrase is not able to pull translations, due to an error saying FORBIDDEN.

ERROR: Forbidden
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14ef89c]

goroutine 1 [running]:
github.com/phrase/phrase-cli/cmd/internal.LocalesForProjects(0xc000297ce0, 0x17973c0, 0xc00035aa50, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/phrase/phrase-cli/cmd/internal/shared.go:38 +0x1bc
github.com/phrase/phrase-cli/cmd/internal.(*PullCommand).Run(0xc000191cb8, 0xc0002991e0, 0x15, 0x0)
        /go/src/github.com/phrase/phrase-cli/cmd/internal/pull.go:55 +0x21f
github.com/phrase/phrase-cli/cmd.initPull.func1(0xc00029e2c0, 0xc00027cac0, 0x0, 0x2)
        /go/src/github.com/phrase/phrase-cli/cmd/pull.go:24 +0xef
github.com/spf13/cobra.(*Command).execute(0xc00029e2c0, 0xc00027caa0, 0x2, 0x2, 0xc00029e2c0, 0xc00027caa0)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x1a57c20, 0x101a501, 0x0, 0x0)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/phrase/phrase-cli/cmd.Execute()
        /go/src/github.com/phrase/phrase-cli/cmd/root.go:64 +0x2d
main.main()
        /go/src/github.com/phrase/phrase-cli/main.go:8 +0x25

In terminal for phrase version output as follows:

ERROR: Forbidden
2.4.4

I am on macOS Monterrey 12.2.1 and used homebrew to install phrase.

Any ideas? Thanks for helping out

theSoenke commented 2 years ago

Hey @mrhahn3000, thanks for reporting this. Is it possible that your access token does not have the necessary permissions to pull translations from the project? In any case, the panic after the forbidden errors is definitely an issue and something we will look into

mrhahn3000 commented 2 years ago

Hey @theSoenke, thanks for the reply.

So the token was valid and had sufficient permissions.

However, I already was able to solve the issue by complete fresh install via homebrew. A pure brew reinstall phrase did not work. Only brew uninstall phrase + brew cleanup + brew install phrase did the trick. Since that the FORBIDDEN message is gone, and everything works as expected.

So feel free to close it, or if you still want to dig into the panic, let it open ;)

Thanks for the great Software :)

Cheers