So I took over a new position at a company, and we had been using Discourse - then moved to AnswerHub () and I am probably going to move us back to Discourse.
I have used discourse before - but this install wasnât really managed and no one knows what/how to access whatâs currently running, and I need to get logged in and start Adminâing it (itâs been set to Read Only).
I am trying to figure out where itâs being run on the box - I am not good with Docker but I have these instances:
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
local_discourse/app latest --------------- 11 months ago 2.366 GB
discourse/discourse 1.3.10 --------------- 11 months ago 1.539 GB
discourse/discourse 1.3.5 --------------- 18 months ago 1.501 GB
Whatâs the easiest way to get in here and get access to the Admin?
Edit: I was able to enter the docker image (app) so thatâs a start
The script is pretty flexible â it can create a new account for you, but if you give it the email address of an already existing user, it will grant that user admin privileges instead
So after performing the above, I had to upgrade Docker on my server. With that done, everything came back up. However, I performed
./launcher rebuild app
And after waiting ~7min it failed with the following being the last bits of the readout:
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && ln -s /shared/uploads public/uploads failed with return #<Process::Status: pid 3244 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["mkdir -p public/forum", "cd public/forum && ln -s ../uploads && ln -s ../backups", "ln -s /shared/uploads public/uploads", "ln -s /shared/backups public/backups"]}
14a2deb1523549c18cc7c67e71ec4774f267df552dce399e61105dd3ef954dc0
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
i will as soon as a reboot works - after rebooting the server Iâm not able to connect to it - itâs denying my ssh key - so working with my server team.
Alright so to update here⌠after a bunch of smaller issues, I finally got back to the server and have re-ran sudo ./launcher rebuild app and hereâs the last few screens:
Start compiling CSS: 2017-12-21 16:43:51 UTC
Compiling css for default 2017-12-21 16:43:51 UTC
precompile target: desktop Default
precompile target: mobile Default
precompile target: desktop_rtl Default
precompile target: mobile_rtl Default
precompile target: desktop
precompile target: mobile
precompile target: desktop_rtl
precompile target: mobile_rtl
Done compiling CSS: 2017-12-21 16:43:55 UTC
I, [2017-12-21T16:43:55.601570 #13] INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps
I, [2017-12-21T16:43:55.605198 #13] INFO -- : File > /usr/local/bin/discourse chmod: +x
I, [2017-12-21T16:43:55.608262 #13] INFO -- : File > /usr/local/bin/rails chmod: +x
I, [2017-12-21T16:43:55.611291 #13] INFO -- : File > /usr/local/bin/rake chmod: +x
I, [2017-12-21T16:43:55.614115 #13] INFO -- : File > /etc/update-motd.d/10-web chmod: +x
I, [2017-12-21T16:43:55.615837 #13] INFO -- : File > /etc/logrotate.d/rails chmod:
I, [2017-12-21T16:43:55.617538 #13] INFO -- : File > /etc/logrotate.d/nginx chmod:
I, [2017-12-21T16:43:55.620467 #13] INFO -- : File > /etc/runit/1.d/00-ensure-links chmod: +x
I, [2017-12-21T16:43:55.623444 #13] INFO -- : File > /root/.bash_profile chmod: 644
I, [2017-12-21T16:43:55.623611 #13] INFO -- : > echo "Beginning of custom commands"
I, [2017-12-21T16:43:55.624942 #13] INFO -- : Beginning of custom commands
I, [2017-12-21T16:43:55.625256 #13] INFO -- : > cd /var/www/discourse && mkdir -p public/forum
I, [2017-12-21T16:43:55.627464 #13] INFO -- :
I, [2017-12-21T16:43:55.627544 #13] INFO -- : > cd /var/www/discourse && cd public/forum && ln -s ../uploads && ln -s ../backups
I, [2017-12-21T16:43:55.629935 #13] INFO -- :
I, [2017-12-21T16:43:55.630007 #13] INFO -- : > cd /var/www/discourse && ln -s /shared/uploads public/uploads
ln: failed to create symbolic link 'public/uploads/uploads': File exists
I, [2017-12-21T16:43:55.632215 #13] INFO -- :
I, [2017-12-21T16:43:55.632491 #13] INFO -- : Terminating async processes
I, [2017-12-21T16:43:55.632581 #13] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 43
I, [2017-12-21T16:43:55.632690 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 156
2017-12-21 16:43:55.632 UTC [43] LOG: received fast shutdown request
2017-12-21 16:43:55.632 UTC [43] LOG: aborting any active transactions
2017-12-21 16:43:55.632 UTC [50] LOG: autovacuum launcher shutting down
156:signal-handler (1513874635) Received SIGTERM scheduling shutdown...
2017-12-21 16:43:55.635 UTC [47] LOG: shutting down
156:M 21 Dec 16:43:55.657 # User requested shutdown...
156:M 21 Dec 16:43:55.657 * Saving the final RDB snapshot before exiting.
2017-12-21 16:43:55.676 UTC [47] LOG: database system is shut down
156:M 21 Dec 16:43:55.884 * DB saved on disk
156:M 21 Dec 16:43:55.884 # Redis is now ready to exit, bye bye...
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && ln -s /shared/uploads public/uploads failed with return #<Process::Status: pid 3256 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["mkdir -p public/forum", "cd public/forum && ln -s ../uploads && ln -s ../backups", "ln -s /shared/uploads public/uploads", "ln -s /shared/backups public/backups"]}
4b44820ca7a1600d0687192790f721fb36267d7e8529b1a0107b9a0df2977b56
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
any guidance here?
edit: looks like itâs failing here first on the custom commands:
I, [2017-12-21T16:43:55.630007 #13] INFO -- : > cd /var/www/discourse && ln -s /shared/uploads public/uploads
ln: failed to create symbolic link 'public/uploads/uploads': File exists
and then everything shuts down⌠what already exists is this:
We were already setup for folders correctly - it was actually due to creating symbolic links which already existed - so it failed. Now weâre back up⌠however, login is disabled due to being in read only mode. Any way to change this manually so I can login?
Ran discourse disable_readonly and got the âThe site is now fully operable.â message, but when I reload the browser it doesnât let me login, saying itâs still in readonly mode. I performed a ./launcher reload app and it is still in readonly mode
rails c
Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
Discourse.disable_readonly_mode(Discourse::READONLY_MODE_KEY)
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
yeah I ran all 3 of those - and it stays out of read only mode (or at least doesnât have the note at the top about being in read only mode), when I try to login it does this and stays there: