Defect #18926

issue_categories in REST API is not working - page not found

Added by Miklós Kriván over 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-
Resolution: Affected version:2.5.3

Description

When I try to call http://server.domain/redmine/projects/1/issue_categories.json?key=my_key the answer is Page Not Found 404

The Log contains this:

ActionController::RoutingError (No route matches [GET] "/service/projects/1/issue_categories.json"):
actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.19) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.19) lib/rails/engine.rb:484:in `call'
railties (3.2.19) lib/rails/application.rb:231:in `call'
railties (3.2.19) lib/rails/railtie/configurable.rb:30:in `method_missing'
/data/redmine/service/dispatch.fcgi:16:in `call'
rack (1.4.5) lib/rack/handler/fastcgi.rb:66:in `serve'
rack (1.4.5) lib/rack/handler/fastcgi.rb:28:in `block in run'
rack (1.4.5) lib/rack/handler/fastcgi.rb:27:in `each'
rack (1.4.5) lib/rack/handler/fastcgi.rb:27:in `run'
/data/redmine/service/dispatch.fcgi:20:in `<main>'

But if I try to call any other REST API functions everything works perfect:

Example http://server.domain/redmine/projects/1/issues.json?key=my_key returns with all issues from project id=1

I have tried the users API as well it worked.

I have tried also with other versions (2.3-stable, 2.4-stable, 2.5-stable and 2.6-stable) the situation is exatle the same.

I have installed everything with SVN checkout and the suggested building procedure.
All of the functionality in redmine works perfect only this REST_API is not available.

Why is it important? Because I have started to use the redmineNB plugin for netbeans and it gives me also the page not found message of course and there is no category info of course. First I was thinking a plugin bug but when I called the REST API manually I have realized that Page Not found answer is real.

I have checked also the rake route definitions and it gave me good result.

$ bundle exec rake routes | grep categories
Your FCGI gem does not contain the FCGI shared library, running pure ruby instead
project_issue_categories GET /projects/:project_id/issue_categories(.:format) issue_categories#index
POST /projects/:project_id/issue_categories(.:format) issue_categories#create
new_project_issue_category GET /projects/:project_id/issue_categories/new(.:format) issue_categories#new
edit_issue_category GET /issue_categories/:id/edit(.:format) issue_categories#edit
issue_category GET /issue_categories/:id(.:format) issue_categories#show
PUT /issue_categories/:id(.:format) issue_categories#update
DELETE /issue_categories/:id(.:format) issue_categories#destroy

My environment is:

Environment:
Redmine version 2.5.3.stable.13899
Ruby version 2.0.0-p0 (2013-02-24) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.9
Git 1.7.11.3
Filesystem
Redmine plugins:
redmine_helpdesk 0.0.12
redmine_wiki_unc 0.0.3
scrum 0.7.0

Do you have any ideas what could be wrong with it?
Thx. for your help

History

#1 Updated by Jean-Philippe Lang over 7 years ago

The route is properly defined:

project_issue_categories GET /projects/:project_id/issue_categories(.:format) issue_categories#index

What is the /service part at the beginning of the URL that the application sees ?

#2 Updated by Miklós Kriván over 7 years ago

I have installed redmine in SUB_URI environment under the server and I am using FCGI.
I am using /redmine /service and /projekt for this for different purposes.

So when I call http://server.domain/service/projects/1/issues.json?key=my_key or http://server.domain/projekt/projects/1/issues.json?key=my_key I got the same issue.

The interesting thing that only the issue_categories API is not working all of the others are good.

Perhaps one more thing could be important as well:

In condig/environmen.rb I add of course this:

RedmineApp::Application.routes.default_scope = {
:path => ENV['RAILS_RELATIVE_URL_ROOT'],
:shallow_path => ENV['RAILS_RELATIVE_URL_ROOT']
}

RedmineApp::Application.initialize!

The ENV values comes from the proper FCGI startup. So it works.

Thx. for your help

#3 Updated by Miklós Kriván over 7 years ago

If I want to summarize the situation as simple as I can:

This URL http://server.domain/service/projects/1/issues.json?key=my_key works.
It means returns with the proper json result.

And this URL http://server.domain/service/projects/1/issue_categories.json?key=my_key does not work.
It results 404 Page Not found message.

#4 Updated by Miklós Kriván almost 7 years ago

  • Status changed from New to Resolved

In Redmine version 3.0.3 this problem is solved. Thx.

#5 Updated by Toshi MARUYAMA almost 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF