ankitpokhrel / jira-cli

🔥 Feature-rich interactive Jira command line.
MIT License
3.92k stars 199 forks source link

Error: invalid character '<' looking for beginning of value when trying to fetch any commands #630

Open csamcharles opened 1 year ago

csamcharles commented 1 year ago

Describe the bug When performing any commands I get this error

~ 1m 34s ❯ jira issue list
Error: invalid character '<' looking for beginning of value

Please provide following details

  1. JiraCLI Version:

    ~ ❯ jira version
    (Version="1.4.0", GitCommit="eb842e18014303a575fde8e19508b3c7c13982c5", CommitDate="2023-05-09T07:09:45+00:00", GoVersion="go1.19.4", Compiler="gc", Platform="darwin/amd64")   
  2. Are you using Jira cloud or on-premise jira server?

    
    SERVER INFO
    -----------

Version: 8.20.11 Build Number: 820011 Deployment Type: Server Default Locale:


4. What operating system are you using? Also mention version.

macOs Ventura 13.3.1 (a)

5. What terminal are you using? Also mention version.

iTerm 2 Build 3.4.19



**To Reproduce**

Steps to reproduce the behavior:
1. install latest jira-cli
2. configure server via jira init
3. try any fetch of issues etc
4. See error:
~ 1m 16s ❯ jira issue list -a$(jira me)
Error: invalid character '<' looking for beginning of value
ankitpokhrel commented 1 year ago

Hi @csamcharles, I believe your instance is returning a HTML response because of some error (probably 404). Could you please check which endpoint is failing with jira issue list -a$(jira me) --debug?

csamcharles commented 1 year ago

Hi @ankitpokhrel , thanks for the reply. Redacted the host and bearer which both look correct. Query looks correct also:

~ ❯ jira issue list -q "summary ~ test" --debug
Using config file: /Users/chcharles/.config/.jira/.config.yml
JQL: project="TBX3" AND summary ~ test ORDER BY created DESC
⠧ Fetching issues...

REQUEST DETAILS
------------------------------------------------------------

GET /rest/api/3/search?jql=project%3D%22TBX3%22+AND+summary+~+test+ORDER+BY+created+DESC&startAt=0&maxResults=100 HTTP/1.1
glucas commented 1 year ago

I'm seeing the same, and this was working at some point previously... I can directly query with the host, request, and bearer auth reported by --debug and I get the expected JSON response. In my case it may be related to differences when using a corporate VPN, but I don't see why httpie works fine when I'm connected and jira-cli does not.

akozumpl commented 1 year ago

Hi, I've had the same and realized my instance does not support the v3 REST requests.

The solution in my case was doing jira init over and choosing "Local" Jira instance.

miloslavnosek commented 1 year ago

Hi, I've had the same and realized my instance does not support the v3 REST requests.

The solution in my case was doing jira init over and choosing "Local" Jira instance.

This has solved this issue for me.

Thank you!