jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

Segfault on `v` action for any issue in Sprints layout

Open XVilka opened this issue 1 year ago β€’ 4 comments

Describe the bug A crash on the v action in Sprints layout for any issue:

β”˜panic: runtime error: invalid memory address or nil pointer dereference                                                            β•‘                                                                                                                                                       β•‘
 [signal SIGSEGV: segmentation violation code=0x2 addr=0xa0 pc=0x102d7acd4]                                                                                                                                          β•‘
                                                             β•‘                                                                                                                                                       β•‘
                                                             β•‘             goroutine 29 [running]:                                                                                                                   β•‘
                                                             β•‘                                    github.com/ankitpokhrel/jira-cli/internal/view.Issue.header({{0x14000b4e828, 0x17}, 0x0, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}, 0x0, ...}, ...})                                       β•‘                                                                                                                                                       β•‘
                      	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/issue.go:203 +0x64                                                                                                 β•‘
                                                             β•‘                                                      github.com/ankitpokhrel/jira-cli/internal/view.Issue.fragments({{0x14000b4e828, 0x17}, 0x0, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}, 0x0, ...}, ...})                  β•‘                                                                                                                                                       β•‘
                                           	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/issue.go:127 +0x98                                                                         β•‘
                                                             β•‘                                                                              github.com/ankitpokhrel/jira-cli/internal/view.Issue.RenderedOut({{0x14000b4e828, 0x17}, 0x0, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}, 0x0, ...}, ...}, ...)                                                                                                                                           β•‘
                                                             β•‘            	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/issue.go:76 +0xac                                          β•‘
                                                             β•‘                                                                                                             github.com/ankitpokhrel/jira-cli/internal/view.(*SprintList).Render.func1.2({0x10306db80?, 0x0?})       β•‘                                                                                                                                                       β•‘
                                                      	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/sprint.go:66 +0xb4                                                                 β•‘
                                                             β•‘                                                                                      github.com/ankitpokhrel/jira-cli/pkg/tui.(*Preview).initContents.func1.2.1(0x140001b6690, 0x2, 0x28?, 0x14000a60f50?)          β•‘                                                                                                                                                       β•‘
                                                   	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/preview.go:255 +0xe4                                                                     β•‘
                                                             β•‘                                                                                  github.com/ankitpokhrel/jira-cli/pkg/tui.(*Preview).initContents.func1.2()                                                         β•‘                                                                                                                                                       β•‘
    	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/preview.go:259 +0x30═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
 Showing 20 results from board "XXX Kanban" of project "YYY"                       created by github.com/ankitpokhrel/jira-cli/pkg/tui.(*Preview).initContents.func1
                                                                                                                                                                                 	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/preview.go:244 +0x264

Please provide following details

  1. JiraCLI Version:
  (Version="1.3.0", GitCommit="ed84fe74f68ba1b2cf0504a931ca09a03b2c9fed", CommitDate="2023-01-02T09:59:32+00:00", GoVersion="go1.19.4", Compiler="gc", Platform="darwin/arm64")

Happens also on the latest git version: https://github.com/ankitpokhrel/jira-cli/commit/eef7ae96c20a26f16b26f178c07ebe7df11511ab

  1. Are you using Jira cloud or on-premise jira server?
SERVER INFO
-----------

Version: 	 8.20.6
Build Number: 	 820006
Deployment Type: Server
Default Locale:  
  1. What operating system are you using? Also mention version.
    macOS 13.2 ARM64
    
  2. What terminal are you using? Also mention version.
     iTerm 2 Build 3.4.19
    

To Reproduce

Steps to reproduce the behavior:

  1. jira sprint list
  2. Select any sprint and issue, then press v
  3. See error

Expected behavior No crash

XVilka avatar Mar 30 '23 05:03 XVilka

That's strange! It looks like the API is not returning Assignee field. I cannot reproduce this behavior in 8.22.2, are you able to add assignee from the UI?

Also, could you please check what response you get with this cURL request and what you get in the Assignee field?

$ curl --request GET \
  --url 'https://<host>/rest/api/2/issue/<issue-key>' \
  --user "<user>:$JIRA_API_TOKEN" \
  --header 'Accept: application/json'

ankitpokhrel avatar Mar 31 '23 07:03 ankitpokhrel

@ankitpokhrel indeed, in the JSON returned from this curl request there is no 'Assignee' field at all, not even null-valued one.

XVilka avatar Apr 06 '23 05:04 XVilka

@XVilka This looks something specific to your installation, are you able to set assignee from the UI? Also wondering if the problem is only with that particular field or other fields are missing as well? (Apologies for late response)

ankitpokhrel avatar May 06 '23 09:05 ankitpokhrel

@ankitpokhrel yes, recently upgraded Jira version to 9.4.4 and also pulled latest code from git, the issue is still here. I am able to set assignee from the UI.

XVilka avatar May 08 '23 06:05 XVilka