-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
unable to run jira init #682
Comments
updating: Login username: With I can login to our jira server. |
not sure why login-id is getting removed |
@laxmij-cmd Make sure you have both JIRA_API_TOKEN=<api_token> and JIRA_AUTH_TYPE=bearer |
@laxmij-cmd do you still need help? |
I am having the same issue as above reported by @laxmij-cmd. I am setting as env variables JIRA_API_TOKEN="<api_token>" # not base64 encoded, exactly as copied from https://id.atlassian.com/manage-profile/security/api-tokens
JIRA_AUTH_TYPE=bearer The following command works for me:
But the jira init
? Installation type: Cloud
? Link to Jira server: https://<host>.atlassian.net
? Login email: email@domain.com
✗ Received unexpected response '403 Forbidden' from jira. Please try again. We tried with my organisation admin and they also have the same issue, so I can rule out the problem being insufficient permissions. Any idea what I may be doing wrong? |
I noticed the same behavior on Windows 10 under Git Bash ( I'm using this version: $ jira version
(Version="1.5.1", GitCommit="0e0f82d52ef5a775d2cc662fbe38d9732b9b5c59", CommitDate="2024-01-20T10:48:06+00:00", GoVersion="go1.21.5", Compiler="gc", Platform="windows/amd64") |
I'm having the same problem. I'm on macOS 14.2.1 with ZSH. I've set
As with others, using curl returns the expected data. |
Same problem here. I've tried installed a handful of versions (1.5.4, 1.5.0, 1.4.0, 1.2.0), all see the same issue. |
@ankitpokhrel What information can we get you that's most helpful to debug, if anything? |
Hey Folks, I'll look into this this week. Could you please provide some more details like:
Also, if you are using Jira Cloud you may NOT need to set |
I'm using Jira Cloud, version Removing the auth type param seems to have the same effect; I get a This curl command succeeds: This |
Same here $ jira init --installation cloud --server "https://<host>.atlassian.net" --login "<email>" --debug
⠇ Verifying login details...
REQUEST DETAILS
------------------------------------------------------------
GET /rest/api/2/myself HTTP/1.1
Host: <host>.atlassian.net
Authorization: Bearer <JIRA_API_TOKEN>
✗ Received unexpected response '403 Forbidden' from jira. Please try again. EDIT: I changed the auth type (removed the env variable |
Exact same thing as @mattiapesentiAGADE. I'm on Jira cloud version 1001.0.0-SNAPSHOT. I've also just tried removing the JIRA_AUTH_TYPE=bearer ENV variable, and it works now! |
Hi @erawhctim, This is strange as I've the same setup and is working fine. Could you please double check the params you are passing to jira-cli and provide any additional context that might be helpful to debug? |
I'm creating my PAT via: Account Icon -> Profile -> Security -> Create and Manage API tokens. I can confirm that this value is set correctly for the JIRA_API_TOKEN env. var; is there another way to set this value that I can try? My org uses Okta SSO to authenticate with our Jira instance, so perhaps some non-standard auth. setup is interfering here. Another thing I tried is running this same script within our CI environment, which has an org-level, pre-provisioned Jira API token & service user. That seems to be working! So this might just be something that I can't run locally with user-created PAT's. Can you help me better understand the auth. request that happens when |
make sure to export JIRA_API_TOKEN in your environment:
|
Same issue here. I've set these in my JIRA_AUTH_TYPE=bearer
JIRA_API_TOKEN=<my-token> I can verify these return the expected values with $ curl https://{host}.atlassian.net/rest/api/2/myself --user {email}:$JIRA_API_TOKEN But when I run $ jira init Installed $ jira version
(Version="1.5.1", GitCommit="0e0f82d52ef5a775d2cc662fbe38d9732b9b5c59", CommitDate="2024-01-20T10:48:06+00:00", GoVersion="go1.21.5", Compiler="gc", Platform="darwin/arm64") |
HI @Drew-Daniels, its a cloud installation if your domain is |
Ah, my mistake. Thanks for pointing that out. As soon as I removed the Thank you! |
Strange! My org uses Okta SSO too and I don't have any issue with the tokens.
It basically calls bunch of JIRA API to generate the config file. First it verifies login details using /myself endpoint, and if that's successful it will fetch project and board details. |
fwiw i was struggling with the same issue but when i |
I had the same problem. New Jira Cloud instance, authorised through Apple ID. Jira init 403'd each time. PAT seemed to be fine, I could curl with it. The fix, as per the last comment, was to remove JIRA_AUTH_TYPE=bearer from my environment variables. Connects fine now. |
FWIW. I went through ALL the troubleshooting steps I could find trying to resolve 401s for a couple of days. |
I'm having this problem on Windows, having just installed I can use But it works ok in my Linux VM. |
Hi,
I have to use jira-cli on "on-premise installation" of jira. I did following:
Now when I run "jira init" error is
Installation type: Local
Link to Jira Server: <link to our jira server"
Login username:
Received unexpected response '401' from jira. Please try again
With I can login to .
Please help.
Thanks
Laxmi
The text was updated successfully, but these errors were encountered: