Errore: gli utenti non possono creare nuovi account

Ciao! Abbiamo recentemente riscontrato un errore che ci ha lasciato perplessi. Forse qualcuno ha un’idea di cosa lo stia causando. Apprezzeremmo qualsiasi aiuto.

Grazie!

Priorità/Gravità: Grave

Piattaforma: Discourse 3.1.0.beta2 (più recente)

Descrizione: Gli utenti non possono creare nuovi account.

L’evento recente che abbiamo fatto è stato l’aggiornamento dell’istanza Lightsail (Ubuntu 20.4) a un’altra con specifiche più elevate (crea snapshot, crea istanza da snapshot).

Tutto è andato bene, anche se l’errore di registrazione potrebbe essere iniziato prima, ne eravamo solo ignari (è un BBS di 2 mesi).

Abbiamo provato in modalità provvisoria, succede la stessa cosa. Abbiamo utilizzato diversi account email, da diversi indirizzi IP e diversi dispositivi, stesso risultato.

Passaggi riproducibili: Visita il sito, prova a registrare un nuovo account.

Screenshot pertinenti:

Ho potuto incorporare solo un’immagine, quindi eccone un’altra:

Oltre ai plugin, abbiamo installato i componenti DiscoTOC e Discourse Docs Card Filter.

Ho visto un errore simile con Discourse Encrypt qualche tempo fa che non dava errori visibili nella console, ma non sembra che tu abbia quel plugin. Ci sono errori nel tuo /logs?

Per il caso precedente simile, la registrazione con un invito si è rivelata più rivelatrice se puoi provare?

2 Mi Piace

Grazie per averlo controllato! Sì, ho letto quell’altro argomento ma sembrava molto diverso dal mio.

Ho provato con il codice di invito, stesso risultato.

Ecco i miei log di errore.

puoi

tail -f /var/discourse/shared/standalone/log/rails/production.log

e vedere cosa vedi quando provi a creare un account.

3 Mi Piace

Ciao @minami,

Qui, l’invito significa creare un link di invito sulla pagina tuosito/my/invited/pending e provare a registrarsi con quel link sulla pagina degli inviti. Quindi non nella modale. Mi dispiace di non essere stato troppo chiaro. Spero che in questo modo tu possa ottenere alcuni errori pertinenti su /logs.

2 Mi Piace

Okay I tried the invite link and got an internal server error.

Info
Failed to handle exception in exception app middleware : ActiveRecord::RecordNotUnique : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "idx_category_users_user_id_categor

12:44 am

rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'

rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'

activerecord (7.0.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'

activesupport (7.0.4.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'

activesupport (7.0.4.1) lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'

activerecord (7.0.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'

activesupport (7.0.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'

activerecord (7.0.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'

activerecord (7.0.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'

activerecord (7.0.4.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:150:in `exec_insert_all'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `exec_insert_all'

activerecord (7.0.4.1) lib/active_record/insert_all.rb:41:in `execute'

activerecord (7.0.4.1) lib/active_record/persistence.rb:213:in `insert_all!'

app/models/user.rb:1961:in `set_default_categories_preferences'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:400:in `block in make_lambda'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:599:in `block in invoke_after'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:599:in `each'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:599:in `invoke_after'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:108:in `run_callbacks'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:929:in `_run_create_callbacks'

activerecord (7.0.4.1) lib/active_record/callbacks.rb:461:in `_create_record'

activerecord (7.0.4.1) lib/active_record/timestamp.rb:108:in `_create_record'

activerecord (7.0.4.1) lib/active_record/persistence.rb:1067:in `create_or_update'

activerecord (7.0.4.1) lib/active_record/callbacks.rb:457:in `block in create_or_update'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'

activerecord (7.0.4.1) lib/active_record/autosave_association.rb:370:in `around_save_collection_association'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:138:in `run_callbacks'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:929:in `_run_save_callbacks'

activerecord (7.0.4.1) lib/active_record/callbacks.rb:457:in `create_or_update'

activerecord (7.0.4.1) lib/active_record/timestamp.rb:126:in `create_or_update'

activerecord (7.0.4.1) lib/active_record/persistence.rb:648:in `save!'

activerecord (7.0.4.1) lib/active_record/validations.rb:53:in `save!'

activerecord (7.0.4.1) lib/active_record/transactions.rb:302:in `block in save!'

activerecord (7.0.4.1) lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:314:in `transaction'

activerecord (7.0.4.1) lib/active_record/transactions.rb:350:in `with_transaction_returning_status'

activerecord (7.0.4.1) lib/active_record/transactions.rb:302:in `save!'

activerecord (7.0.4.1) lib/active_record/suppressor.rb:54:in `save!'

app/models/invite_redeemer.rb:155:in `create_user_from_invite'

app/models/invite_redeemer.rb:219:in `invited_user'

app/models/invite_redeemer.rb:273:in `add_user_to_groups'

app/models/invite_redeemer.rb:237:in `process_invitation'

app/models/invite_redeemer.rb:56:in `block in redeem'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

activesupport (7.0.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'

activerecord (7.0.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'

activerecord (7.0.4.1) lib/active_record/transactions.rb:209:in `transaction'

app/models/invite_redeemer.rb:54:in `redeem'

app/models/invite.rb:226:in `redeem'

app/controllers/invites_controller.rb:284:in `perform_accept_invitation'

actionpack (7.0.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'

actionpack (7.0.4.1) lib/abstract_controller/base.rb:215:in `process_action'

actionpack (7.0.4.1) lib/action_controller/metal/rendering.rb:53:in `process_action'

actionpack (7.0.4.1) lib/abstract_controller/callbacks.rb:234:in `block in process_action'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'

app/controllers/application_controller.rb:414:in `block in with_resolved_locale'

i18n (1.12.0) lib/i18n.rb:322:in `with_locale'

app/controllers/application_controller.rb:414:in `with_resolved_locale'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'

activesupport (7.0.4.1) lib/active_support/callbacks.rb:138:in `run_callbacks'

actionpack (7.0.4.1) lib/abstract_controller/callbacks.rb:233:in `process_action'

actionpack (7.0.4.1) lib/action_controller/metal/rescue.rb:22:in `process_action'

actionpack (7.0.4.1) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'

activesupport (7.0.4.1) lib/active_support/notifications.rb:206:in `block in instrument'

activesupport (7.0.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'

activesupport (7.0.4.1) lib/active_support/notifications.rb:206:in `instrument'

actionpack (7.0.4.1) lib/action_controller/metal/instrumentation.rb:66:in `process_action'

actionpack (7.0.4.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'

activerecord (7.0.4.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'

actionpack (7.0.4.1) lib/abstract_controller/base.rb:151:in `process'

actionview (7.0.4.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.4.1) lib/action_controller/metal.rb:188:in `dispatch'

actionpack (7.0.4.1) lib/action_controller/metal.rb:251:in `dispatch'

actionpack (7.0.4.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'

actionpack (7.0.4.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'

actionpack (7.0.4.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'

actionpack (7.0.4.1) lib/action_dispatch/journey/router.rb:32:in `each'

actionpack (7.0.4.1) lib/action_dispatch/journey/router.rb:32:in `serve'

actionpack (7.0.4.1) lib/action_dispatch/routing/route_set.rb:852:in `call'

lib/middleware/omniauth_bypass_middleware.rb:74:in `call'

rack (2.2.6.2) lib/rack/tempfile_reaper.rb:15:in `call'

rack (2.2.6.2) lib/rack/conditional_get.rb:40:in `call'

rack (2.2.6.2) lib/rack/head.rb:12:in `call'

actionpack (7.0.4.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:369:in `call'

rack (2.2
Backtrace
rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:69:in `exec_params'


rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:69:in `exec_params'


activerecord-7.0.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'


activesupport-7.0.4.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'


activesupport-7.0.4.1/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'


activerecord-7.0.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'


activesupport-7.0.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'


activerecord-7.0.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'


activerecord-7.0.4.1/lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'


activerecord-7.0.4.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:150:in `exec_insert_all'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `exec_insert_all'


activerecord-7.0.4.1/lib/active_record/insert_all.rb:41:in `execute'


activerecord-7.0.4.1/lib/active_record/persistence.rb:213:in `insert_all!'


/var/www/discourse/app/models/user.rb:1961:in `set_default_categories_preferences'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:400:in `block in make_lambda'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:599:in `block in invoke_after'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:599:in `each'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:599:in `invoke_after'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:108:in `run_callbacks'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:929:in `_run_create_callbacks'


activerecord-7.0.4.1/lib/active_record/callbacks.rb:461:in `_create_record'


activerecord-7.0.4.1/lib/active_record/timestamp.rb:108:in `_create_record'


activerecord-7.0.4.1/lib/active_record/persistence.rb:1067:in `create_or_update'


activerecord-7.0.4.1/lib/active_record/callbacks.rb:457:in `block in create_or_update'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'


activerecord-7.0.4.1/lib/active_record/autosave_association.rb:370:in `around_save_collection_association'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:127:in `block in run_callbacks'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:138:in `run_callbacks'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:929:in `_run_save_callbacks'


activerecord-7.0.4.1/lib/active_record/callbacks.rb:457:in `create_or_update'


activerecord-7.0.4.1/lib/active_record/timestamp.rb:126:in `create_or_update'


activerecord-7.0.4.1/lib/active_record/persistence.rb:648:in `save!'


activerecord-7.0.4.1/lib/active_record/validations.rb:53:in `save!'


activerecord-7.0.4.1/lib/active_record/transactions.rb:302:in `block in save!'


activerecord-7.0.4.1/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:314:in `transaction'


activerecord-7.0.4.1/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'


activerecord-7.0.4.1/lib/active_record/transactions.rb:302:in `save!'


activerecord-7.0.4.1/lib/active_record/suppressor.rb:54:in `save!'


/var/www/discourse/app/models/invite_redeemer.rb:155:in `create_user_from_invite'


/var/www/discourse/app/models/invite_redeemer.rb:219:in `invited_user'


/var/www/discourse/app/models/invite_redeemer.rb:273:in `add_user_to_groups'


/var/www/discourse/app/models/invite_redeemer.rb:237:in `process_invitation'


/var/www/discourse/app/models/invite_redeemer.rb:56:in `block in redeem'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'


activesupport-7.0.4.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'


activerecord-7.0.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'


activerecord-7.0.4.1/lib/active_record/transactions.rb:209:in `transaction'


/var/www/discourse/app/models/invite_redeemer.rb:54:in `redeem'


/var/www/discourse/app/models/invite.rb:226:in `redeem'


/var/www/discourse/app/controllers/invites_controller.rb:284:in `perform_accept_invitation'


actionpack-7.0.4.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'


actionpack-7.0.4.1/lib/abstract_controller/base.rb:215:in `process_action'


actionpack-7.0.4.1/lib/action_controller/metal/rendering.rb:53:in `process_action'


actionpack-7.0.4.1/lib/abstract_controller/callbacks.rb:234:in `block in process_action'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'


/var/www/discourse/app/controllers/application_controller.rb:414:in `block in with_resolved_locale'


i18n-1.12.0/lib/i18n.rb:322:in `with_locale'


/var/www/discourse/app/controllers/application_controller.rb:414:in `with_resolved_locale'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:127:in `block in run_callbacks'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:138:in `run_callbacks'


actionpack-7.0.4.1/lib/abstract_controller/callbacks.rb:233:in `process_action'


actionpack-7.0.4.1/lib/action_controller/metal/rescue.rb:22:in `process_action'


actionpack-7.0.4.1/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'


activesupport-7.0.4.1/lib/active_support/notifications.rb:206:in `block in instrument'


activesupport-7.0.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'


activesupport-7.0.4.1/lib/active_support/notifications.rb:206:in `instrument'


actionpack-7.0.4.1/lib/action_controller/metal/instrumentation.rb:66:in `process_action'


actionpack-7.0.4.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'


activerecord-7.0.4.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'


actionpack-7.0.4.1/lib/abstract_controller/base.rb:151:in `process'


actionview-7.0.4.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.4.1/lib/action_controller/metal.rb:188:in `dispatch'


actionpack-7.0.4.1/lib/action_controller/metal.rb:251:in `dispatch'


actionpack-7.0.4.1/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'


actionpack-7.0.4.1/lib/action_dispatch/routing/route_set.rb:32:in `serve'


actionpack-7.0.4.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'


actionpack-7.0.4.1/lib/action_dispatch/journey/router.rb:32:in `each'


actionpack-7.0.4.1/lib/action_dispatch/journey/router.rb:32:in `serve'


actionpack-7.0.4.1/lib/action_dispatch/routing/route_set.rb:852:in `call'


/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:74:in `call'


rack-2.2.6.2/lib/rack/tempfile_reaper.rb:15:in `call'


rack-2.2.6.2/lib/rack/conditional_get.rb:40:in `call'


rack-2.2.6.2/lib/rack/head.rb:12:in `call'


actionpack-7.0.4.1/lib/action_dispatch/http/permissions_policy.rb:38:in `call'


/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'


/var/www/discourse/lib/middleware/anonymous_cache.rb:369:in `call'


rack-2.2.6.2/lib/rack/session/abstract/id.rb:266:in `context'


rack-2.2.6.2/lib/rack/session/abstract/id.rb:260:in `call'


actionpack-7.0.4.1/lib/action_dispatch/middleware/cookies.rb:704:in `call'


actionpack-7.0.4.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'


activesupport-7.0.4.1/lib/active_support/callbacks.rb:99:in `run_callbacks'


actionpack-7.0.4.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'


actionpack-7.0.4.1/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'


actionpack-7.0.4.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.4.1/lib/rails/rack/logger.rb:40:in `call_app'


railties-7.0.4.1/lib/rails/rack/logger.rb:27:in `call'


/var/www/discourse/config/initializers/100-quiet_logger.rb:20:in `call'


/var/www/discourse/config/initializers/100-si
2 Mi Piace

Ci proverò la prossima volta :smile:

Vedo qualcosa riguardo a set_default_categories_preferences lì dentro. Potresti provare a reimpostare quelle preferenze e vedere se aiuta?

Vedo un problema simile qui:

2 Mi Piace

Ho resettato le categorie predefinite disattivate e l’errore è stato risolto! Ma perché questo dovrebbe influire sulle registrazioni degli utenti?! Ma forse questo è per un altro giorno.

Grazie mille per l’aiuto @JammyDodger! Ho bisogno di dormire :sleepy:

2 Mi Piace

Nessun problema. Lieti di esserti stati d’aiuto. :slight_smile:

2 Mi Piace

Credo che questa situazione sia ora mitigata da:

1 Mi Piace