Unable to create the anonymous user

Added by Ben Spencer about 11 years ago

About your application's environment
Ruby version 1.8.7 (i686-linux)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Edge Rails revision unknown
Application root /opt/redmine/redmine-1.1.2
Environment production
Database adapter mysql
Database schema version 20101114115359

I've just installed Redmine with passenger but when I access Redmine, I end up with this error in the production.log file:

Processing WelcomeController#index (for 99.140.219.131 at 2011-04-08 01:11:26) [GET]
Parameters: {"action"=>"index", "controller"=>"welcome"}

RuntimeError (Unable to create the anonymous user.):
app/models/user.rb:471:in `anonymous'
app/models/user.rb:462:in `current'
.
.
.

There were no problems creating the database (via rake db:migrate) and as far as I know all of the file/directory permissions are correct. What did I miss?

Thank You

Replies (4)

RE: Unable to create the anonymous user - Added by Felix Schäfer about 11 years ago

Please paste the full trace.

RE: Unable to create the anonymous user - Added by Ben Spencer about 11 years ago

Processing WelcomeController#index (for 99.140.219.131 at 2011-04-08 01:46:24) [GET]
Parameters: {"action"=>"index", "controller"=>"welcome"}

RuntimeError (Unable to create the anonymous user.):
app/models/user.rb:471:in `anonymous'
app/models/user.rb:462:in `current'
app/controllers/application_controller.rb:101:in `check_if_login_required'
passenger (3.0.6) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.6) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.6) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
passenger (3.0.6) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.6) helper-scripts/passenger-spawn-server:99

Rendering /opt/redmine/redmine-1.1.2/public/500.html (500 Internal Server Error)

RE: Unable to create the anonymous user - Added by Ben Spencer about 11 years ago

I played with the Apache configuration (and realized aliases aren't supported as a sub-URI) and things work now. It seems to be related to the alias vs sub-URI I was using. This issue has been resolved.

RE: Unable to create the anonymous user - Added by echo girl almost 11 years ago

hello,I have the same question when I update redmine to V1.2
when redmine in V1.0,everything is ok.but when I update it to V1.2,the full trace is:
Processing ProjectsController#show (for 10.9.8.143 at 2011-07-11 16:38:39) [GET]
Parameters: {"action"=>"show", "id"=>"cloudapp", "controller"=>"projects"}
Setting Columns (1.4ms) SHOW FIELDS FROM `settings`
SQL (0.3ms) SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings`
Setting Load (0.3ms) SELECT * FROM `settings` WHERE (`settings`.`name` = 'autologin') LIMIT 1
Token Columns (1.3ms) SHOW FIELDS FROM `tokens`
Token Load (1.2ms) SELECT * FROM `tokens` WHERE (`tokens`.`value` = '86df0341fafbaa5e06347a42b682e7f11c7ab69f' AND `tokens`.`action` = 'autologin')
AnonymousUser Columns (1.3ms) SHOW FIELDS FROM `users`
AnonymousUser Load (2.0ms) SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1
WARNING: Can't mass-assign these protected attributes: login
SQL (0.1ms) BEGIN
CACHE (0.0ms) SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1
SQL (0.1ms) ROLLBACK

RuntimeError (Unable to create the anonymous user.):
app/models/user.rb:516:in `anonymous'
app/models/user.rb:507:in `current'
app/controllers/application_controller.rb:104:in `check_if_login_required'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendered rescues/_trace (34.2ms)
Rendered rescues/_request_and_response (0.4ms)
Rendering rescues/layout (internal_server_error)

(1-4/4)