Can't create database

Infos:

  • Used Zammad version: 3.0.X
  • Used Zammad installation source: Source
  • Operating system: Cent OS 7
  • Browser + version: Google Chrome 75.0.3770.100

Expected behavior:

  • rake db command work normally. No database problem on zammad.

Actual behavior:

  • rake db:create output look like these…

[zammad@osboxes ~]$ rake db:create --trace
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create
PG::InsufficientPrivilege: ERROR: permission denied to create database
: CREATE DATABASE “zammad_development” ENCODING = ‘utf8’
Couldn’t create ‘zammad_development’ database. Please check your configuration.
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied to create database
: CREATE DATABASE “zammad_development” ENCODING = ‘utf8’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in async_exec' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:inblock (2 levels) in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/dependencies/interlock.rb:46:in block in permit_concurrent_loads' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/concurrency/share_lock.rb:185:inyield_shares’
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/dependencies/interlock.rb:45:in permit_concurrent_loads' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:inblock in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:613:in block (2 levels) in log' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:612:in block in log' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/notifications/instrumenter.rb:21:ininstrument’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:604:in log' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:71:inexecute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/schema_statements.rb:46:in create_database' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/postgresql_database_tasks.rb:19:increate’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:117:in create' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:137:inblock in create_current’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:305:in block in each_current_configuration' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:302:ineach’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:302:in each_current_configuration' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:136:increate_current’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/railties/databases.rake:27:in block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:inblock in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:inexecute’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:214:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:194:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:183:ininvoke’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:160:in invoke_task' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:inblock (2 levels) in top_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:inblock in top_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:125:in run_with_threads' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:110:intop_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:83:in block in run' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:186:instandard_exception_handling’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:80:in run' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/exe/rake:27:in<top (required)>’
/usr/local/rvm/gems/ruby-2.4.4/bin/rake:23:in load' /usr/local/rvm/gems/ruby-2.4.4/bin/rake:23:in
/usr/local/rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in eval' /usr/local/rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in

Caused by:
PG::InsufficientPrivilege: ERROR: permission denied to create database
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in async_exec' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:inblock (2 levels) in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/dependencies/interlock.rb:46:in block in permit_concurrent_loads' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/concurrency/share_lock.rb:185:inyield_shares’
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/dependencies/interlock.rb:45:in permit_concurrent_loads' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:inblock in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:613:in block (2 levels) in log' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:612:in block in log' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.1.7/lib/active_support/notifications/instrumenter.rb:21:ininstrument’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:604:in log' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:71:inexecute’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/schema_statements.rb:46:in create_database' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/postgresql_database_tasks.rb:19:increate’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:117:in create' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:137:inblock in create_current’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:305:in block in each_current_configuration' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:302:ineach’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:302:in each_current_configuration' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:136:increate_current’
/usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.1.7/lib/active_record/railties/databases.rake:27:in block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:inblock in execute’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:273:inexecute’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:214:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:194:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/task.rb:183:ininvoke’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:160:in invoke_task' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:inblock (2 levels) in top_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:116:inblock in top_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:125:in run_with_threads' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:110:intop_level’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:83:in block in run' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:186:instandard_exception_handling’
/usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/lib/rake/application.rb:80:in run' /usr/local/rvm/gems/ruby-2.4.4/gems/rake-12.3.2/exe/rake:27:in<top (required)>’
/usr/local/rvm/gems/ruby-2.4.4/bin/rake:23:in load' /usr/local/rvm/gems/ruby-2.4.4/bin/rake:23:in
/usr/local/rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in eval' /usr/local/rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in
Tasks: TOP => db:create

Steps to reproduce the behavior:

  • related to git comment , I still can’t figure out where am I and what i need to do to solve this db problem or permission problem.

With Respect
Nangi

  • Are you trying to use Zammad in development on porpose?
  • What’s the user you’re running the command on?

I’m trying to implement Zammad onto an organization to help in CRM but want to avoid charges as much as possible, am I using Zammad in wrong purpose ?

I tried this command on normal user, zammad user and root. The output upthere is captured while I execute command as zammad.

  • I tried sudo rake db:create which will ask for zammad user’s password and I don’t know what is it…
  • on root attemp, output will be something like no root role to execute this command

I feel like i’m at my wit’s end :dizzy_face:

I look forward to receiving your response
With Respect
Nangi

I don’t get the charges part, as you’re in community version as far as I’m aware.
I think that using the developer-mode of Zammad is a bad idea, if you want to integrate productive into your environment.

At any point (and this doesn’t just count for paid services), please note that we are not able to support and troubleshoot custom code.

Ensure you have either postgresql or mysql installed.
As far as I’m aware, you can run the createdb-command as zammad-user.

Normally Zammad uses the socks connection for the DB, but you can use authentication as well, but this requires you to adjust config/database.yml which holds those information.

Edit: If you’re more comfortable with the packages, you should use those.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.