Upgrade gone sideways [deprecated Guest Gate plugin]

I hadn’t upgraded my Discourse in quite some time but finally got around to doing it. Tried from the web app and it errored, went into the server and tried to rebuild the container and had several space issues. N

Expanded my VM and tried to rebuild app and now I am receiving errors and can’t start container.

I ran discourse-doctor as instructed and this seems like the main error that I see:

2022-10-12 12:12:37.418 UTC [1669] LOG:  database system was shut down at 2022-10-12 12:09:46 UTC
2022-10-12 12:12:37.452 UTC [1666] LOG:  database system is ready to accept connections
I, [2022-10-12T12:12:42.229967 #1]  INFO -- :
I, [2022-10-12T12:12:42.230254 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
Error: PostgreSQL version 13 is not installed
I, [2022-10-12T12:12:42.270949 #1]  INFO -- :
I, [2022-10-12T12:12:42.271177 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
I, [2022-10-12T12:12:42.323520 #1]  INFO -- :
I, [2022-10-12T12:12:42.323738 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
I, [2022-10-12T12:12:42.375939 #1]  INFO -- :
I, [2022-10-12T12:12:42.376152 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
I, [2022-10-12T12:12:42.429960 #1]  INFO -- :
I, [2022-10-12T12:12:42.430282 #1]  INFO -- : Terminating async processes
I, [2022-10-12T12:12:42.430313 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgr                                                                                                                                                              es:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 1666
2022-10-12 12:12:42.430 UTC [1666] LOG:  received fast shutdown request
2022-10-12 12:12:42.445 UTC [1666] LOG:  aborting any active transactions
2022-10-12 12:12:42.446 UTC [1666] LOG:  worker process: logical replication launcher (PID 1675) exited with exit code 1
2022-10-12 12:12:42.447 UTC [1670] LOG:  shutting down
2022-10-12 12:12:42.562 UTC [1666] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 1699 exit 2>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
bootstrap failed with exit code 2
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
4f664b8bc922e1b17fb754c66f5f729d1a78d609d10fe228677248e3cace99bb
==================== END REBUILD LOG ====================
Failed to rebuild app.




Any tips for how to get back up and running?

How long has it been since your last upgrade? Did you follow PostgreSQL 13 update.

Have you tried rebuilding more than once?

Well, I somehow got everything running – it looks like I had manually forced the old PSQL – but my entire forum is gone. :rofl: Just a blank forum now.

Going with a backup restore and hoping for the best. :man_shrugging:

You should remove the (deprecated) guest gate plugin and replace it with the theme component.

5 Likes

Okay, so I started the restore and it was working and then I got logged out.

Is there any way to track if the restore is done? I am getting lots of errors on the site (can’t login via SSO) and don’t want to do anything until it is done.

I’m seeing this error in the logs:

NoMethodError (undefined method `external_id' for #<Topic:0x00007f6463504ac8>
Did you mean?  extend)
(eval):2:in `external_id'
app/serializers/topic_view_serializer.rb:109:in `include_external_id?'
(eval):36:in `_fast_attributes'
app/controllers/application_controller.rb:545:in `render_json_dump'
app/controllers/topics_controller.rb:1204:in `block (2 levels) in perform_show_response'
app/controllers/topics_controller.rb:1194:in `perform_show_response'
app/controllers/topics_controller.rb:169:in `show'
app/controllers/application_controller.rb:413:in `block in with_resolved_locale'
app/controllers/application_controller.rb:413:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:202:in `call'
activemodel (7.0.3.1) lib/active_model/attribute_methods.rb:458:in `method_missing'
(eval):2:in `external_id'
app/serializers/topic_view_serializer.rb:109:in `include_external_id?'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:375:in `include?'
(eval):36:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
activesupport (7.0.3.1) lib/active_support/json/encoding.rb:22:in `encode'
activesupport (7.0.3.1) lib/active_support/json/encoding.rb:22:in `encode'
activesupport (7.0.3.1) lib/active_support/core_ext/object/json.rb:42:in `to_json'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:331:in `to_json'
multi_json (1.15.0) lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json (1.15.0) lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json (1.15.0) lib/multi_json/adapter.rb:25:in `dump'
multi_json (1.15.0) lib/multi_json.rb:139:in `dump'
app/controllers/application_controller.rb:545:in `render_json_dump'
app/controllers/topics_controller.rb:1204:in `block (2 levels) in perform_show_response'
actionpack (7.0.3.1) lib/action_controller/metal/mime_responds.rb:214:in `respond_to'
app/controllers/topics_controller.rb:1194:in `perform_show_response'
app/controllers/topics_controller.rb:169:in `show'
plugins/discourse-category-lockdown/plugin.rb:65:in `show'
actionpack (7.0.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.0.3.1) lib/abstract_controller/base.rb:215:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/rendering.rb:53:in `process_action'
actionpack (7.0.3.1) lib/abstract_controller/callbacks.rb:234:in `block in process_action'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
app/controllers/application_controller.rb:413:in `block in with_resolved_locale'
i18n (1.12.0) lib/i18n.rb:322:in `with_locale'
app/controllers/application_controller.rb:413:in `with_resolved_locale'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack (7.0.3.1) lib/abstract_controller/callbacks.rb:233:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
activesupport (7.0.3.1) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.3.1) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.0.3.1) lib/action_controller/metal/instrumentation.rb:66:in `process_action'
actionpack (7.0.3.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord (7.0.3.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (7.0.3.1) lib/abstract_controller/base.rb:151:in `process'
actionview (7.0.3.1) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (3.0.0) lib/mini_profiler/profiling_methods.rb:85:in `block in profile_method'
actionpack (7.0.3.1) lib/action_controller/metal.rb:188:in `dispatch'
actionpack (7.0.3.1) lib/action_controller/metal.rb:251:in `dispatch'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (7.0.3.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.0.3.1) lib/action_dispatch/routing/route_set.rb:852:in `call'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
rack (2.2.4) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.4) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.4) lib/rack/head.rb:12:in `call'
actionpack (7.0.3.1) lib/action_dispatch/http/permissions_policy.rb:38:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
rack (2.2.4) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.4) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/cookies.rb:697:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (7.0.3.1) lib/active_support/callbacks.rb:99:in `run_callbacks'
actionpack (7.0.3.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
logster (2.11.3) lib/logster/middleware/reporter.rb:43:in `call'
railties (7.0.3.1) lib/rails/rack/logger.rb:40:in `call_app'
railties (7.0.3.1) lib/rails/rack/logger.rb:27:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
request_store (1.5.1) lib/request_store/middleware.rb:19:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
rack (2.2.4) lib/rack/method_override.rb:24:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.4) lib/rack/sendfile.rb:110:in `call'
actionpack (7.0.3.1) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'
rack-mini-profiler (3.0.0) lib/mini_profiler/profiler.rb:249:in `call'
message_bus (4.2.0) lib/message_bus/rack/middleware.rb:60:in `call'
lib/middleware/request_tracker.rb:202:in `call'
railties (7.0.3.1) lib/rails/engine.rb:530:in `call'
railties (7.0.3.1) lib/rails/railtie.rb:226:in `public_send'
railties (7.0.3.1) lib/rails/railtie.rb:226:in `method_missing'
rack (2.2.4) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.4) lib/rack/urlmap.rb:58:in `each'
rack (2.2.4) lib/rack/urlmap.rb:58:in `call'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'
unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
unicorn (6.1.0) lib/unicorn/http_server.rb:143:in `start'
unicorn (6.1.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/2.7.0/bin/unicorn:25:in `load'
vendor/bundle/ruby/2.7.0/bin/unicorn:25:in `<main>'


Oof, disabled the Guest Gate, rebuilt one more time and am up and running. Thanks for the help guys.

4 Likes

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