Top Menu

Jump to content
Home
    • Projects
    • Activity
    • Work packages
    • Calendars
    • Team planners
    • Boards
    • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • 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
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums
  • Feature tour
    Feature tour
You are here:
  1. Forums
  2. General discussion

Content

creation of development table

Added by Mario Ganz over 8 years ago

I’d like to create the development table because my cronjob is constantly mailing me mails complaining about this thing missing.
Ceredentials in my database.yml are inserted and I use this https://www.openproject.org/help/faq/development-questions/ to create the tables in the existing database:

RAILS_ENV=development rake db:create

This job then stops because it demands root@localhost login for the sql database. As said above there is a dev user and a dev table. The login via web frontend into the dev database works.

What am I missing?


Replies (9)

RE: creation of development table - Added by Martin Linkhorst over 8 years ago

Hi Mario,

do you use our packaged (https://www.openproject.org/open-source/packaged-installation/) or manual installation (https://www.openproject.org/open-source/manual-installation/)?

please paste your config/database.yml (skip any sensitive data).

RE: creation of development table - Added by Mario Ganz over 8 years ago

I tried the packaged installation but it failed so I used the manual installation. openproject is installed in the home directory of the openproject user.

    #MySQL (default setup).
    production:
      adapter: mysql2
      database: openproject
      host: localhost
      username: openproject
      password: foo
      encoding: utf8

    development:
      adapter: mysql2
      database: openproject_dev
      host: localhost
      username: openproject_dev
      password: foo
      encoding: utf8

        #Warning: The database defined as "test" will be erased and
        #re-generated from your development database when you run "rake".
        #Do not set this db to the same as development or production.
    test:
      adapter: mysql2
      database: openproject_test
      host: localhost
      username: root
      password:
      encoding: utf8

    #test_pgsql:
      #adapter: postgresql
      #encoding: unicode
      #database: openproject_test
      #pool: 5
      #username: openproject
      #password:

    #test_sqlite3:
      #adapter: sqlite3
      #database: db/test.sqlite3

RE: creation of development table - Added by Martin Linkhorst over 8 years ago

looks like rails 3.2.21 wants to create the test database whenever you create the development database:

https://github.com/rails/rails/blob/v3.2.21/activerecord/lib/active_record/railties/databases.rake#L637

so the rake task wants to connect to your database server as root as specified in the test: block of your database.yml

your options:

  • create a valid configuration for the test database (use a user that’s allowed to connect)
  • drop the database key form the test database’s configuration (code looks like this should work but i didn’t test)
  • drop the test block entirely

give it a try and let us know how it goes.

RE: creation of development table - Added by Mario Ganz over 8 years ago

Thanks for helping.
I added a comment on each line of the test config section and created the database and filled it. Everything worked fine.
Though I am still receiving a email per minute from the cron daemon containing this:

require 'rails/all'... 1.170s
Bundler.require... 4.170s
Application.initialize!... [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
5.580s
[Worker(host:foo_hostname_bar pid:16496)] Starting job worker [Worker(host:foo_hostname_bar pid:16496)] No more jobs available. Exiting

RE: creation of development table - Added by Mario Ganz over 8 years ago

Okay, I eliminated this message by now, but I am still receiving an email every minute. Is that supposed to work like this?

RE: creation of development table - Added by Martin Linkhorst over 8 years ago

please paste the contents of your crontab

RE: creation of development table - Added by Mario Ganz over 8 years ago

Thats the crontab. I think its the default config.

*/1 * * * * cd /home/openproject/openproject; /home/openproject/.rvm/gems/ruby-2.1.4/wrappers/rake jobs:workoff

RE: creation of development table - Added by Mario Ganz over 8 years ago

No idea?

RE: creation of development table - Added by Martin Linkhorst over 8 years ago

hmm, difficult to say. looks to me like there’s a job stuck in the queue that happens to send that email.

could you please provide the last hundred or so lines of the logfiles:

  • production log (or development if you run it in dev). should be at RAILS_ROOT/log/production.log or under /var/log/openproject
  • the worker log if it’s there

if you’re familiar with sql or the rails console, we could confirm that there’s a job present and which one it is
SQL: select * from delayed_jobs;
Rails Console: Delayed::Job.all

before that you could remove the entry from the crontab to confirm that it’s triggered by the cronjob/delayed_job stuff.

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