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

Cannot read property 'status' of undefined #10

Closed
funkybaboon opened this issue Mar 13, 2018 · 6 comments
Closed

Cannot read property 'status' of undefined #10

funkybaboon opened this issue Mar 13, 2018 · 6 comments

Comments

@funkybaboon
Copy link

When running jira all I get

$ jira all
TypeError: Cannot read property 'status' of undefined
    at handleResponseError (/usr/local/lib/node_modules/jira-node-cli/lib/utils/ErrorHandleUtils.js:12:49)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I'm using node 8.9.3. Any hints?

@lusarz
Copy link
Owner

lusarz commented Mar 13, 2018

Thanks @funkybaboon for information. This error comes from:

const message = ERROR_MESSAGES[err.response.status];

seems like I incorrectly assumed that err.response returned with axios library is always defined. I'll improve error handling for this case until tomorrow.

@lusarz
Copy link
Owner

lusarz commented Mar 13, 2018

@funkybaboon
I updated error handling in this scenario. You can update tool using npm install -g jira-node-cli, and after running jira all you should get more detailed error output. I would be grateful for information about error you get now - it will help me with further debugging.

Thanks for help!

@funkybaboon
Copy link
Author

now i get

$ jira all
An unexpected error occurred during communication with JIRA: 
Code: ENOTFOUND
Syscall: getaddrinfo
Errno: ENOTFOUND

@lusarz
Copy link
Owner

lusarz commented Mar 14, 2018

It looks like known problem with NodeJS:
https://stackoverflow.com/questions/23259697/error-getaddrinfo-enotfound-in-nodejs-for-get-call

It may be related with https. Could you try to manually edit .jirarc file (placed in home directory), and change API_URL:
https://<your-org-name>.atlassian.net into http://<your-org-name>.atlassian.net ?

@funkybaboon
Copy link
Author

The error was that in the setup I entered the org name with https

https://<your-org-name>.atlassian.net

instead of

<your-org-name>.atlassian.net

This resulted in an incorrect entry in the .jirarc:

{
  "API_URL": "https://https://<your-org-name>.atlassian.net",
  "TOKEN": "<your-token>"
}

After removing the obsolete https it works now. Thanks for looking into 👍

@lusarz
Copy link
Owner

lusarz commented Mar 14, 2018

You're welcome. That means I have to hurry up with #1 implementation :)

@lusarz lusarz closed this as completed Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants