Top Menu

Jump to content
    Global modules

    Global modules

    • Home
    • Projects
    • Activity
    • Work packages
    • Gantt charts
    • Calendars
    • Team planners
    • Boards
    • News
    Home
    Home
Help
    Getting started
    • Introduction video
  • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support
  • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation

User menu

Sign in
Forgot your password?

or sign in with your existing account

OpenProject ID Google

Side Menu

Collapse project menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Expand project menu
General discussion
  1. OpenProject Community
  2. OpenProject
  3. Forums
  4. General discussion
  5. "uninitialized constant" error when trying to reset password with Rails console

"uninitialized constant" error when trying to reset password with Rails console

Added by Keith Brautigam 9 days ago

I am running OpenProject Community Edition 16.3.1 with PostgreSQL 17.5.

I have lost access to my account and am attempting to reset it using the Rails console as described on this page:
https://www.openproject.org/docs/installation-and-operations/operation/faq/

However, I get an "uninitialized constant" error:

irb(main):001> user = User.find(1)
(irb):1:in '<main>': uninitialized constant User (NameError)
       from <internal:kernel>:168:in 'Kernel#loop'
       from /opt/openproject/vendor/bundle/ruby/3.4.0/gems/irb-1.15.2/exe/irb:9:in '<top (required)>'
       from /opt/openproject/vendor/bundle/ruby/3.4.0/bin/irb:25:in 'Kernel#load'
       from /opt/openproject/vendor/bundle/ruby/3.4.0/bin/irb:25:in '<top (required)>'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Kernel.load'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli.rb:452:in 'Bundler::CLI#exec'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor.rb:538:in 'Bundler::Thor.dispatch'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/cli.rb:29:in 'Bundler::CLI.start'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/gems/3.4.0/gems/bundler-2.6.9/exe/bundle:28:in 'block in <top (required)>'
       from /opt/openproject/vendor/ruby-3.4.5/lib/ruby/3.4.0/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'

I would appreciate any suggestions. Thank you!


Replies (2)

RE: "uninitialized constant" error when trying to reset password with Rails console - Added by Alexander Stock 4 days ago

Hello Keith,

that looks faily similar to a bug which has been recently reported:

 

While this has not been fixed yet, the report at least provides a workaround to open the console with this command and then perform the FAQ steps you mentioned:

sudo openproject run rails c

Best,
Alexander

RE: "uninitialized constant" error when trying to reset password with Rails console - Added by Keith Brautigam 4 days ago

Thank you very much Alex. This allows the script to work for resetting the password. As it turns out my issue is deeper (it doesn't find me... I think because somehow I have gotten two database schemas and it's using the one without me or any of my users). But what you suggested exactly answered what I asked, and thus I think this particular issue can be considered closed. Thank you again very much.

  • (1 - 2/2)
Loading...