Open link in a new tab

Content

Expand project menu

creation of development table

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?

Message actions

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).

Message actions

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
Message actions

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.

Message actions

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
Message actions

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

Message actions

please paste the contents of your crontab

Message actions

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
Message actions

No idea?

Message actions

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.