Project

General

Profile

uninitialized constant Rack::URLMap::PATH_INFO

Added by s h almost 9 years ago

Hi,

currently I am trying to install redmine 3.0.3 on my bananian-router-board (similair a raspberrypi) but unfortunatelly without success. Therefore I hope you could help me.

I followed the generic installation guide and some others howtos to use ssl and install into a suburi "https://_ip_/redmine" but I don't kow... either nginx or thin do not work like expected as I get the message "502 Bad Gateway" in my webbrowser.

In the folder /var/run/thin is a redmine instance created:
srwxrwxrwx 1 thin web_001 0 Jun 11 12:19 redmine.0.sock=

my Problem now is:

Unexpected error while processing request: uninitialized constant Rack::URLMap::PATH_INFO

What do I have to do now?

As this while thing already took me several days I would be really happy about some help
thanks!

Configfiles

/etc/thin/redmine.yml

---
chdir: /var/www/redmine
environment: production
timeout: 30
log: /var/log/thin/redmine.log
pid: /var/run/thin/redmine.pid
max_conns: 128
max_persistent_conns: 32
require: []
wait: 30
socket: /var/run/thin/redmine.sock
daemonize: true
user: thin
group: web_001
servers: 1
prefix: /

/etc/nginx/sites-enabled/default

upstream php-handler {
        server unix:/var/run/php5-fpm.sock;
}

#REDIRECT
server {
        listen 80;
        server_name router;
        return 301 https://$server_name$request_uri;  # enforce https
}

#HTTPS
server {
        listen 443 ssl;
        server_name router;

        # Path to the root of your installation
        root /var/www/;
        index index.php index.html index.htm;

        client_max_body_size 10G; # set max upload size

        ssl on;
        ssl_certificate /etc/ssl/nginx/router.crt;
        ssl_certificate_key /etc/ssl/nginx/router.key;
        ssl_session_timeout 5m;
        ssl_protocols SSLv3 TLSv1;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+EXP;
        ssl_prefer_server_ciphers on;

        fastcgi_buffers 64 4K;

        # Disable gzip to avoid the removal of the ETag header
        gzip off;

        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

        error_page 403 /core/templates/403.php;
        error_page 404 /core/templates/404.php;

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

    location / {
                try_files $uri $uri/ index.php;
    }

    location /redmine {
            proxy_set_header        Host $host;
            proxy_set_header        X-Real-IP $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header        X-Forwarded-Proto $scheme;
            proxy_redirect          http:// https://;
            proxy_pass              http://unix:/var/run/thin/redmine.0.sock;
    }

        location ~ ^(.+?\.php)(/.*)?$ {
                try_files $1 =404;

                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$1;
                fastcgi_param PATH_INFO $2;
                fastcgi_param HTTPS on;
                fastcgi_pass php-handler;
        }

        # Optional: set long EXPIRES header on static assets
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires 30d;
                # Optional: Don't log access to assets
                access_log off;
        }
}

Logfiles

/var/log/nginx/access.log

192.168.43.61 - - [11/Jun/2015:12:19:40 +0200] "GET /redmine/ HTTP/1.1" 502 172 "-" "Mozilla/5.0 (X11; Ubuntu; Linux$

/var/log/nginx/error.log
is empty

/var/log/thin/redmine.0.log

>> Writing PID to /var/run/thin/redmine.0.pid
>> Changing process privilege to thin:web_001
>> Using rack adapter
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 128
>> Listening on /var/run/thin/redmine.0.sock, CTRL+C to stop


Replies (4)

RE: uninitialized constant Rack::URLMap::PATH_INFO - Added by Bertrand Michas about 8 years ago

Hello, I migrated redmine from 2.6.0 to 3.2.0 and I have now exactly the same error as you.

Unexpected error while processing request: uninitialized constant Rack::URLMap::PATH_INFO

Redmine is always in Error 500, and no log in log/production.log

I don't know what to do... Did you find a solution ?

EDIT:

Here are debug logs of thin server :

!! Unexpected error while processing request: uninitialized constant Rack::URLMap::PATH_INFO
uninitialized constant Rack::URLMap::PATH_INFO
/var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/urlmap.rb:44:in `call'
/usr/lib/ruby/vendor_ruby/thin/connection.rb:80:in `block in pre_process'
/usr/lib/ruby/vendor_ruby/thin/connection.rb:78:in `catch'
/usr/lib/ruby/vendor_ruby/thin/connection.rb:78:in `pre_process'
/usr/lib/ruby/vendor_ruby/thin/connection.rb:53:in `process'
/usr/lib/ruby/vendor_ruby/thin/connection.rb:38:in `receive_data'
/usr/lib/ruby/vendor_ruby/eventmachine.rb:187:in `run_machine'
/usr/lib/ruby/vendor_ruby/eventmachine.rb:187:in `run'
/usr/lib/ruby/vendor_ruby/thin/backends/base.rb:61:in `start'
/usr/lib/ruby/vendor_ruby/thin/server.rb:159:in `start'
/usr/lib/ruby/vendor_ruby/thin/controllers/controller.rb:86:in `start'
/usr/lib/ruby/vendor_ruby/thin/runner.rb:185:in `run_command'
/usr/lib/ruby/vendor_ruby/thin/runner.rb:151:in `run!'
/usr/bin/thin:6:in `<main>'

RE: uninitialized constant Rack::URLMap::PATH_INFO - Added by cyber xndr about 8 years ago

The issue is related to thin package version. Version that provided in ubuntu/debian repositories is too old. You should delete it using your packet manager and install thin directly via bundle install from your redmine directory. g++ will required for some dependencies in this case.

apt-get install g++
cd /var/www/redmine/
echo "gem 'thin'" >> Gemfile
bundle install --without development test

That fixes the problem for me. Notice also that thin command is not available anymore, so you should run it manualy from the /var/lib/gems/1.9.1/gems/thin-1.6.4/bin directory.

Original solution source:
http://blaise.ca/blog/2015/06/14/howto-redmine-3-0-with-debian-wheezy-nginx-thin/

RE: uninitialized constant Rack::URLMap::PATH_INFO - Added by Bertrand Michas about 8 years ago

Thanks for the reply. It makes sense. I will try this.
:)

RE: uninitialized constant Rack::URLMap::PATH_INFO - Added by Bertrand Michas almost 8 years ago

Hello,
All works now. Thanks to you :)

I would like to say that I had to install those dependencies on Debian Jessie in order to execute "bundler install":

apt-get install ruby ruby-dev g++ build-essential libmysqlclient-dev libmagick++-dev

After the "bundler install" thing, thin is compiled and the bin file is automatically placed in /usr/local/bin.
So if "/usr/local/bin" is in your PATH, you can simply run "thin start".

Then, I created a little bash script to generate a thin configuration for redmine:

#!/bin/bash

# VARIABLES
REDMINE_INSTALL="/var/www/redmine/latest" 

# Some folder creation
sudo mkdir /etc/thin
sudo mkdir /var/log/thin
sudo chmod 755 /var/log/thin

# conf thin for redmine
sudo thin config --config /etc/thin/redmine.yml --chdir $REDMINE_INSTALL --environment production --socket /var/run/redmine/sockets/thin.sock --daemonize --log /var/log/thin/redmine.log --pid /var/run/thin/redmine.pid --user www-data --group www-data --servers 1 --prefix /

# permissions www-data for redmine
sudo chown -R www-data:www-data $REDMINE_INSTALL/public
sudo mkdir -p $REDMINE_INSTALL/tmp/pdf $REDMINE_INSTALL/public/plugin_assets
sudo chown -R www-data:www-data $REDMINE_INSTALL/files $REDMINE_INSTALL/log $REDMINE_INSTALL/tmp $REDMINE_INSTALL/public/plugin_assets
sudo chmod -R 755 $REDMINE_INSTALL/files $REDMINE_INSTALL/log $REDMINE_INSTALL/tmp $REDMINE_INSTALL/public/plugin_assets

# permissions redmine.yml
sudo chown root:root /etc/thin/redmine.yml
sudo chmod 644 /etc/thin/redmine.yml

# socket thin
sudo mkdir -p /var/run/thin
sudo chown -R www-data:www-data /var/run/thin/

# socket redmine
sudo mkdir -p /var/run/redmine/sockets/
sudo chown -R www-data:www-data /var/run/redmine

And I use the following systemd.service to start / stop thin:

[Unit]
Description=A fast and very simple Ruby web server
After=syslog.target network.target

[Service]
Type=forking
User=www-data
Group=www-data
ExecStart=/usr/local/bin/thin start --all /etc/thin/
ExecReload=/user/local/bin/thin restart --all /etc/thin/
ExecStop=/usr/local/bin/thin stop --all /etc/thin
TimeoutSec=300

[Install]
WantedBy=multi-user.target

The last step is configuring Nginx but there is already many tutorials on this on the web.

All works perfectly now :)

Thanks again.

    (1-4/4)