Skip to content
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

Inaccuracies in docker mastodon guide #591

Closed
neunenak opened this issue Apr 6, 2018 · 9 comments
Closed

Inaccuracies in docker mastodon guide #591

neunenak opened this issue Apr 6, 2018 · 9 comments

Comments

@neunenak
Copy link

neunenak commented Apr 6, 2018

I'm new to Mastodon and trying to follow along with https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Docker-Guide.md

Unfortunately, it seems like some of this documentation is incorrect (possibly out of date?) and I've been having trouble getting a working mastodon instance running by following it.

Some of the inconsistencies I've noticed are:
-nothing in that documentation mentions that the .env.production file needs to exist before docker-compose build will even run. I ended up renaming the default .env.production.sample file to .env.production to make the image happy, but I'm not sure why the build step is even checking for this
-if I'm using a prebuilt image from docker Hub rather than compiling from source, does docker-compose build even do anything? it seems like it doesn't
-when I run docker-compose run --rm web rake mastodon:setup, it's not clear to me how the .env.production file that this says it saves relates to the .env.production file that exists outside of docker, in the top-level directory of the cloned repo. When I actually run docker-compose up later, which .env.production will it look for?
-finally, it's not clear from the documentation what steps in the Production guide (https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md) are and are not necessary if running mastodon from docker

@SabreCat
Copy link

SabreCat commented Apr 6, 2018

+1. I've run into all of the above confusions myself trying to work from the docker-compose guide.

In addition, you'll run into
mastodon/mastodon#6883
and
mastodon/mastodon#6911

if you follow the directions as written.

@nightpool
Copy link
Member

@wxcafe i dont use docker

@nightpool nightpool removed their assignment Apr 9, 2018
@wxcafe
Copy link

wxcafe commented Apr 9, 2018

ah. Me neither lol

@neunenak
Copy link
Author

Who is someone who deploys mastodon with docker? I'd like to deploy it this way myself and I'd like to help out with improving the documentation for it if I can.

@neunenak
Copy link
Author

Another issue that I'm running into, when running docker-compose run --rm web rake mastodon:setup, is inconsistent behavior when running the Prepare the database now? Yes Running RAILS_ENV=production rails db:setup ... step. The first time I ran it on my current machine, the contaainer exited with no error message after a few minutes. The next time I ran it, it reported database postgres already exists Killed
. That said, I was able to get it running on another machine, so I don't know what's going on here.

@wxcafe
Copy link

wxcafe commented Apr 10, 2018

@unarist?

@SabreCat
Copy link

SabreCat commented Apr 11, 2018

@neunenak I just finished bringing up my own instance using docker-compose the other day, and ran into the same thing. It throws a warning that it'll delete any extant database if you choose to re-initialize, but it seems the script can't actually do that.

ETA: That said, if the database is OK, that error is benign. My instance came up fine without needing to start over.

lukas-lansky added a commit to lukas-lansky/documentation that referenced this issue Apr 15, 2018
As discussed in mastodon#591, docker will refuse to run the `mastodon:setup` step without some configuration file present.
@SaiGonSeamus
Copy link

We're still running into these problems as well with v2.3.3 on prebuilt images doing a manual chown -R 991:991 public

Running `RAILS_ENV=production rails assets:precompile` ...

I, [2018-04-18T05:06:25.049295 #17]  INFO -- : Writing /mastodon/public/assets/doorkeeper/admin/application-50d68ad91b15067c63771e4811d971d7a56406c472a878021d1fb95d066efd8d.css
I, [2018-04-18T05:06:25.050087 #17]  INFO -- : Writing /mastodon/public/assets/doorkeeper/admin/application-50d68ad91b15067c63771e4811d971d7a56406c472a878021d1fb95d066efd8d.css.gz
I, [2018-04-18T05:06:25.059758 #17]  INFO -- : Writing /mastodon/public/assets/doorkeeper/application-29873392fba1f6a4fd5359214f854d900e24920096164f6e5343dbc0de69df0d.css
I, [2018-04-18T05:06:25.060004 #17]  INFO -- : Writing /mastodon/public/assets/doorkeeper/application-29873392fba1f6a4fd5359214f854d900e24920096164f6e5343dbc0de69df0d.css.gz
I, [2018-04-18T05:06:25.273337 #17]  INFO -- : Writing /mastodon/public/assets/pghero/application-3807e140de3bf52364d575c9c1cba1ed730999b53e2781da4bf8bb15b01791bf.js
I, [2018-04-18T05:06:25.273523 #17]  INFO -- : Writing /mastodon/public/assets/pghero/application-3807e140de3bf52364d575c9c1cba1ed730999b53e2781da4bf8bb15b01791bf.js.gz
I, [2018-04-18T05:06:25.280755 #17]  INFO -- : Writing /mastodon/public/assets/pghero/application-c2618b70600dfedb0f3ba1f916d97a2f93a3f265aba10356abb763bd663d0cbd.css
I, [2018-04-18T05:06:25.280938 #17]  INFO -- : Writing /mastodon/public/assets/pghero/application-c2618b70600dfedb0f3ba1f916d97a2f93a3f265aba10356abb763bd663d0cbd.css.gz
rails aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - /mastodon/public/assets/doorkeeper
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/asset.rb:163:in `write_to'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:209:in `block (2 levels) in compile'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/ivar.rb:170:in `safe_execute'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/future.rb:52:in `block in execute'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
/mastodon/vendor/bundle/ruby/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

That failed! Maybe you need swap space?

All done! You can now power on the Mastodon server 🐘

We are using a bought cert rather than Let's encrypt.

Browser shows a 502 Bad Gateway and the error logs are giving this.

streaming_1 | ERR! Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379

Are the Mastodon systemd Service Files part of the deployment guide required for a docker install? it isn't clear.

Gargron pushed a commit that referenced this issue May 9, 2018
* Adding copy config step

As discussed in #591, docker will refuse to run the `mastodon:setup` step without some configuration file present.

* The secret generation part of docker installation process

As noticed in #6883, you need to generate the keys manually.

* Setting correct file owner is important even in the prebuilt-image case

... as evidenced by issue #6911

* This step should not be necessary -- let's fix the installation instead
@mal0ki
Copy link

mal0ki commented May 9, 2018

Were all issues resolved with the commit?

@Gargron Gargron closed this as completed Oct 21, 2018
progval pushed a commit to progval/documentation that referenced this issue Jun 1, 2020
* Adding copy config step

As discussed in mastodon#591, docker will refuse to run the `mastodon:setup` step without some configuration file present.

* The secret generation part of docker installation process

As noticed in #6883, you need to generate the keys manually.

* Setting correct file owner is important even in the prebuilt-image case

... as evidenced by issue #6911

* This step should not be necessary -- let's fix the installation instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants