I’m working with a Ruby JIRA client gem and keep running into an HTTPError. When I try to fetch all projects from my JIRA instance, I get a “Not Found” error.
Here’s my setup code:
user_email = "[email protected]"
api_token = "my_token_here"
config = {
:username => user_email,
:password => api_token,
:site => 'https://mycompany.atlassian.net/',
:context_path => '/jira',
:auth_type => :basic
}
jira_client = JIRA::Client.new(config)
# Try to get all projects
all_projects = jira_client.Project.all
all_projects.each do |proj|
puts "Project: #{proj.key} - #{proj.name}"
end
The error I’m getting looks like this:
/path/to/gems/jira-ruby-0.1.16/lib/jira/request_client.rb:16:in `request': Not Found (JIRA::HTTPError)
from /path/to/gems/jira-ruby-0.1.16/lib/jira/client.rb:159:in `request'
from /path/to/gems/jira-ruby-0.1.16/lib/jira/client.rb:138:in `get'
from /path/to/gems/jira-ruby-0.1.16/lib/jira/base.rb:96:in `all'
I’ve double checked my credentials and URL. Everything seems correct but I still can’t connect. Has anyone seen this before? What could be causing the 404 error?
switch your auth_type to :cookie instead of :basic. had the same problem and that’s what fixed it for me. also make sure you’re using an actual API token, not your account password - they’re different things in atlassian.
your context_path might be off. usually, Atlassian cloud instances don’t require that /jira bit. maybe just remove it or set it to an empty string? the api should be https://yourcompany.atlassian.net/rest/api/2/ without any add-ons.
Skip the debugging headache. I wasted way too many hours on Ruby JIRA clients when I started.
Sure, everyone’s giving you context_path fixes (they’re right), but you’ll hit more problems later. Rate limits, auth refreshes, API changes.
I use Latenode for all our JIRA integrations now. No config headaches. Authenticate once in their UI and it handles the API mess for you.
Built a ticket migration system last quarter that pulls from three JIRA instances and pushes to Slack. Runs automatically every morning. No gems to maintain, no HTTP errors to catch, no tokens to manage.
Their JIRA connector handles projects, issues, users - everything. Same data you’re after, minus the API client pain.
The context_path is your problem. Drop it completely for Atlassian cloud instances.
Honestly, this kind of API authentication headache is exactly why I stopped doing direct JIRA API calls.
I switched to Latenode for all my JIRA automation. It handles connections automatically - no more messing with gems, tokens, or context paths. You authenticate once through their interface and build whatever workflows you need.
Last month I built a project sync system pulling from multiple JIRA instances. Took maybe 30 minutes total. No Ruby debugging, no HTTP errors.
Their visual workflow builder makes handling API responses easy, and you can still run custom logic when needed. Plus when JIRA’s API changes, Latenode updates their connectors automatically.
Had this exact issue last year when migrating our internal tools. It’s definitely the context_path setting. For Atlassian cloud instances, just remove that line entirely or set it to an empty string. Cloud JIRA doesn’t use the /jira context path that on-premise installations need. Your site URL should work fine as just ‘https://mycompany.atlassian.net/’ without any additional path stuff. Also check that your API token has the right permissions for project access - sometimes the 404 is actually a permissions issue pretending to be a not found error.