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

Invalid memory address #20

Closed
Comradin opened this issue Feb 3, 2022 · 4 comments
Closed

Invalid memory address #20

Comradin opened this issue Feb 3, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Comradin
Copy link
Contributor

Comradin commented Feb 3, 2022

When I try to get the project list gj fails with a segmentation violation using the current 1.11 release:

❯ gj project --host mycompany.atlassian.net/jira
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x754645]

goroutine 1 [running]:
github.com/rsteube/go-jira-cli/internal/api.ListProjects({0x7ffc29591126, 0xbee71c}, {0x21c1f60, 0x0, 0x6000106})
        /home/runner/work/go-jira-cli/go-jira-cli/internal/api/project.go:30 +0x85
github.com/rsteube/go-jira-cli/cmd/gj/cmd.glob..func15(0xc00081fdb8, {0x21c1f60, 0x0, 0x0})
        /home/runner/work/go-jira-cli/go-jira-cli/cmd/gj/cmd/project_view.go:29 +0xb9
github.com/rsteube/go-jira-cli/cmd/gj/cmd.glob..func14(0x21745a0, {0xbf0026, 0x2, 0x2})
        /home/runner/work/go-jira-cli/go-jira-cli/cmd/gj/cmd/project.go:18 +0x33
github.com/spf13/cobra.(*Command).execute(0x21745a0, {0xc000320f60, 0x2, 0x2})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x2174820)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
github.com/rsteube/go-jira-cli/cmd/gj/cmd.Execute()
        /home/runner/work/go-jira-cli/go-jira-cli/cmd/gj/cmd/root.go:22 +0x25
main.main()
        /home/runner/work/go-jira-cli/go-jira-cli/cmd/gj/main.go:6 +0x17

Maybe my auth token or host configuration isn't correct? As the issue view fails as well but with a different error message:

 gj issue view --host mycompany.atlassian.net/jira
Error: 404 Not Found: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible"
 content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><link type='text/css' rel='stylesheet' href='/static-
assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' 
href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link
 type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none"
 /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script>
<div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-
page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state">
<span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a
 href="javascript:window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a>
</li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section>
<!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body">
@rsteube rsteube added the bug Something isn't working label Feb 3, 2022
@rsteube
Copy link
Owner

rsteube commented Feb 3, 2022

So the error wasn't handled in ListProjects - I assume it will now result in the same 404 as issue view.
This indeed could be a problem with the host config (could try to leave out /jira but i think that is essential).
Seems basic auth is not verified at auth login which would explain the error not occuring earlier.

But it looks more like a api version mismatch / error in go-jira itself.
I haven't tried the cloud version of jira myself yet, so there might be an issue.

@rsteube
Copy link
Owner

rsteube commented Feb 3, 2022

@Comradin
Copy link
Contributor Author

Comradin commented Feb 3, 2022

Correct, the removal of the /jira part in the host definition worked.
Now I can list projects and issues.

Maybe validate gj auth login after a new host gets added?
As there was no error I was under the impression everything worked out correctly.

@rsteube
Copy link
Owner

rsteube commented Feb 3, 2022

Yes, would be good to add a validation call to verify the credentials work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants