Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose run --rm web bundle exec rake db:migrate - does not work #13770

Closed
jon-bit opened this issue May 17, 2020 · 2 comments
Closed

Comments

@jon-bit
Copy link

jon-bit commented May 17, 2020

I am trying to set up my own instance of mastodon with docker. no matter what I do or change I get one out of sever error messages that are completely random. I am trying to list as many as I can here but I can't garente that this is all of them but I'm trying my best

Expected behavior

docker-compose run --rm web bundle exec rake db:migrate works and sets up the data base.

Actual behavior

it gives me a error mesage that is what ever it wants to be in the moment.

Steps to reproduce the problem

follow this guide:
[https://www.howtoforge.com/how-to-install-mastodon-social-network-with-docker-on-ubuntu-1804/]

until you get to
docker-compose run --rm web bundle exec rake db:migrate

then you should see

Starting mastodon_redis_1 ... done Starting mastodon_db_1 ... done rake aborted!
PG::ConnectionBad: could not translate host name "db" to address: Name does not resolve
/mastodon/vendor/bundle/ruby/2.5.0/gems/pg-0.21.0/lib/pg.rb:56:in initialize' /mastodon/vendor/bundle/ruby/2.5.0/gems/pg-0.21.0/lib/pg.rb:56:in new'
/mastodon/vendor/bundle/ruby/2.5.0/gems/pg-0.21.0/lib/pg.rb:56:in connect' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:695:in connect'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:220:in initialize' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in new'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in postgresql_connection' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in new_connection'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in checkout_new_connection' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in try_to_checkout_new_connection'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in acquire_connection' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in checkout'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in connection' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in retrieve_connection'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_handling.rb:116:in retrieve_connection' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/connection_handling.rb:88:in connection'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/schema_migration.rb:20:in table_exists?' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/schema_migration.rb:24:in create_table'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1125:in initialize' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in new'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in up' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in migrate'
/mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb:171:in migrate' /mastodon/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in block (2 levels) in <top (required)>'
/mastodon/vendor/bundle/ruby/2.5.0/gems/rake-12.3.0/exe/rake:27:in <top (required)>' /usr/local/bundle/bin/bundle:104:in load'
/usr/local/bundle/bin/bundle:104:in `

'

or this

PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "db" (172.26.0.4) and accepting
TCP/IP connections on port 5432?
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in initialize' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in new'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in connect' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:692:in connect'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in initialize' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in new'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in postgresql_connection' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in new_connection'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in checkout_new_connection' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in try_to_checkout_new_connection'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in acquire_connection' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in checkout'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in connection' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in retrieve_connection'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_handling.rb:118:in retrieve_connection' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/connection_handling.rb:90:in connection'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/tasks/database_tasks.rb:172:in migrate' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/strong_migrations-0.6.6/lib/strong_migrations/database_tasks.rb:4:in migrate'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/railties/databases.rake:60:in block (2 levels) in <top (required)>' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:23:in block in perform'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:20:in perform' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/command.rb:48:in invoke'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands.rb:18:in <top (required)>' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in block in require' /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in load_dependency'
/opt/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in require' /opt/mastodon/bin/rails:4:in

'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

after the command

I apologias. I know there is one more error but I can not find it.

Specifications

it is a XCP-ng VM running docker. 22 GB of memory and 300 GB of storage. not much more to say. pleas help me. I'v been trying to do this for 2 weeks. For two long terrible weeks and can not find anything to help me. thanks in advance.

@ClearlyClaire
Copy link
Contributor

This seems to happen because you need to set a password when bringing up the database (see #13929)

@ChuckNorrison
Copy link

ChuckNorrison commented Oct 6, 2021

the password topic does not solved this missing db declaration. Same here.

@vmstan vmstan converted this issue into discussion #27943 Nov 17, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants