JIRA Python library connection fails with serverInfo endpoint error

I’m trying to connect to our company’s JIRA server using the Python JIRA library but running into issues. Here’s the code I’m using:

config = {
    'server': 'http://192.168.1.25:8080'
}
jira_client = JIRA(options=config, basic_auth=('myuser', 'mypass'))

The problem happens right when I try to create the JIRA client object. I get this error message:

....The requested resource (/rest/api/2/serverInfo) is not available.....
http://192.168.1.25:8080/rest/api/2/serverInfo

Process finished with exit code 1

I’m using the exact same login details that work fine when I access JIRA through my web browser. I have full access to the server and can browse issues normally through the web interface.

What could be causing this connection problem? Is there something wrong with my authentication setup or server configuration?

This is a REST API endpoint issue. JIRA’s library hits the serverInfo endpoint to verify connections during setup. Check if your JIRA instance has REST API enabled - older versions or locked-down setups sometimes disable it. Test manually by going to http://192.168.1.25:8080/rest/api/2/serverInfo in your browser while logged in. If you get JSON data back, the endpoint works. 404 or permission error? That’s your culprit. Also check if your admin set IP restrictions on API access or requires different auth for programmatic vs web access.

Had the same problem with our internal JIRA. Turned out my base URL was wrong. Your server URL is missing the JIRA context path - most installations don’t run on the root URL but under /jira. Try 'server': 'http://192.168.1.25:8080/jira' instead. Check your browser’s address bar when you normally access JIRA - it’ll show you the full path you need. Also ask your JIRA admin if they set up any custom context paths during install.

check your firewall settings - the api port might be blocked even thou web access works. try adding a timeout param to your JIRA connection since network latency can cause these failures. if you’re using HTTPS, test with verify=False temporarily to rule out ssl cert issues.