Redmine with FCGI/Apache: Error - No route matches [GET] "/redmine"

Added by Klaus Friese 4 months ago

Hi,

I made a new Redmine installation on a managed server and I'm using FastCGI for the Apache integration. The installation works fine with the internal server (rails s), but when I call via Apache/FastCGI I get this:

No route matches [GET] "/redmine" 
Rails.root: /usr/www/users/admin/redmine-4.0.4

Application Trace | Framework Trace | Full Trace
Routes
Routes match in priority from top to bottom

and a lot of routes.

Any tipps how to fix this?

Thanks
Klaus

Replies (9)

RE: Redmine error - No route matches [GET] "/redmine" - Added by Liane Hampe 4 months ago

Hi Klaus,

I am not quite sure, but usually when rails throws such an error there were either changes in the rails routes.rb and the application server needs to restart or the requested route is really unknown.

The latter probably is your case. When I would get that error I would check what path you gave apache to the Redmine app. Maybe the reason for the error is there.

Best Regards,
Liane

RE: Redmine error - No route matches [GET] "/redmine" - Added by Klaus Friese 4 months ago

Hi Liane,

Unfortunately I don't have access to the Apache config - it's a managed server and it took a while to get from "Internal server error" to "Rails error message" :)

routes.rb and all redmine files are version 4.0.4 and unchanged.

The redmine entry in my file system is a symbolic link to redmine-4.0.4

.htaccess is:

FcgidWrapper /usr/www/users/admin/redmine/ruby_handler.fcgi .rb
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ruby_handler.fcgi [QSA,L]

ruby_handler.fcgi is:

#!/bin/dash
#export GEM_HOME="$HOME/.gem/ruby/2.3.0/" 
#export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/2.3.0" 

export HOME="/usr/home/admin" 
export GEM_HOME="$HOME/.gem/ruby/" 
export GEM_PATH="/usr/home/admin/.gem/ruby/2.3.0/" 

exec /usr/bin/ruby /usr/www/users/admin/redmine/startup.rb

startup.rb is:

require_relative 'config/environment'

class Rack::PathInfoRewriter
  def initialize(app)
    @app = app
  end

  def call(env)
    env.delete('SCRIPT_NAME')
    parts = env['REQUEST_URI'].split('?')
    env['PATH_INFO'] = parts[0]
    env['QUERY_STRING'] = parts[1].to_s
    env['HOME'] = "/usr/home/admin/" 
    @app.call(env)
  end
end

Rack::Handler::FastCGI.run  Rack::PathInfoRewriter.new(RedmineApp::Application)

The result is here:
http://dataplan.de.dedi444.your-server.de/redmine/

RE: Redmine error - No route matches [GET] "/redmine" - Added by Liane Hampe 4 months ago

Hi Klaus,

Do you symlink to the redmine/public directory?

RE: Redmine error - No route matches [GET] "/redmine" - Added by Liane Hampe 4 months ago

Hi Klaus,

When you intend to run redmine in a subdirectory (https://your-domain.de/redmine), then you can also try to add the following line at the end of your /usr/www/users/admin/redmine-4.0.4/config/environment.rb:

Redmine::Utils::relative_url_root = "/redmine" 

I thought of this due to the No route matches [GET] "/redmine" error message.

Sorry, that I am only guessing the solution because I am running Redmine always with Phusion Passenger.

Best,
Liane

RE: Redmine error - No route matches [GET] "/redmine" - Added by Klaus Friese 4 months ago

Thanks for the ideas - I tried them but they didn't work. I'll prefer using passenger too, but our provider doesn't support that.

I asked in a ruby forum now, if I find a solution over there I will post them here.

RE: Redmine error - No route matches [GET] "/redmine" - Added by Liane Hampe 4 months ago

Hi Klaus,

What a pity! Posting a solution here, found elsewhere, would be very helpful for others.

Good luck!

Liane

RE: Redmine error - No route matches [GET] "/redmine" - Added by Klaus Friese 4 months ago

A helpfull guy on stackoverflow pointed me back to this forum and this old thread:
https://www.redmine.org/boards/2/topics/30676?r=30881

This also works for redmine 4! But no images and CSS is loaded, this files are in /redmine/public/ and in the HTML /redmine/ is referred..

And the next step: I have to migrate an redmine 2.5 database to redmine 4...

RE: Redmine error - No route matches [GET] "/redmine" - Added by Liane Hampe 4 months ago

Great, a big step forward!

The old thread is difficult to find. Klaus, can you modify the topic of this thread to reflect the fcgi installation?

This would refer to the real reason for all the problems. With the search restriction in this forum to consider only the title, it would be more easier to find, I guess.

Concerning the missing link to the /redmine/public directory you could ask your provider. Maybe there are settings options in your server configuration tool you overlooked.

Long way but looks like you're getting it done!

RE: Redmine error - No route matches [GET] "/redmine" - Added by Klaus Friese 4 months ago

The old thread is difficult to find. Klaus, can you modify the topic of this thread to reflect the fcgi installation?

Good idea, I've done that.

(1-9/9)