La reconstruction de Discourse échoue avec une TypeError : impossible de citer Array

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `\u003ctop (required)\u003e'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `\u003cmain\u003e'

Causé par :
TypeError : impossible de citer Array (TypeError)

        else raise TypeError, "can't quote #{value.class.name}"
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:87:in `quote'
Pups::ExecError : cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' a échoué avec le retour #<Process::Status: pid 765 exit 1>
Emplacement de l'échec : /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec a échoué avec les paramètres {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap a échoué avec le code de sortie 1

J’obtiens cette erreur lors d’une reconstruction (après qu’une tentative de mise à jour via /admin/update échouait, j’ai essayé une reconstruction normale).

Des conseils ?

Pouvez-vous partager une plus grande partie du journal ?

Quelques conclusions :

  • Est-ce lié ? La dernière erreur est exactement la même.
  • Cela ne fonctionne pas avec uniquement les plugins officiels
  • Cela semble fonctionner avec tous les plugins sauf si docker_manager est désactivé.

Hmm, il semble qu’il y ait une erreur assez tôt :

761:C 21 Jan 2025 18:15:11.783 # oO0OoO0OoO0Oo Redis démarre oO0OoO0OoO0Oo
761:C 21 Jan 2025 18:15:11.783 # Version Redis=7.0.15, bits=64, commit=00000000, modifié=0, pid=761, vient de démarrer
761:C 21 Jan 2025 18:15:11.783 # Configuration chargée
761:M 21 Jan 2025 18:15:11.784 * Horloge monotone : POSIX clock_gettime
761:M 21 Jan 2025 18:15:11.784 # Avertissement : Impossible de créer le socket d'écoute TCP du serveur *:6379 : bind : Adresse déjà utilisée
761:M 21 Jan 2025 18:15:11.784 # Échec de l'écoute sur le port 6379 (TCP), abandon.
I, [2025-01-21T18:15:21.774268 #1]  INFO -- : 
I, [2025-01-21T18:15:21.774557 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!
StandardError : Une erreur s'est produite, celle-ci et toutes les migrations ultérieures sont annulées : (StandardError)

impossible de citer un Array
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:87:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:238:in `block in quote_bound_value'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:238:in `map!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:238:in `quote_bound_value'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:214:in `replace_bind_variable'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:225:in `block in replace_named_bind_variables'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:219:in `gsub'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:219:in `replace_named_bind_variables'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:167:in `block in sanitize_sql_array'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:415:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/sanitization.rb:166:in `sanitize_sql_array'
/var/www/discourse/lib/mini_sql_multisite_connection.rb:21:in `public_send'
/var/www/discourse/lib/mini_sql_multisite_connection.rb:21:in `encode'
/var/www/discourse/lib/mini_sql_multisite_connection.rb:114:in `sql_fragment'
/var/www/discourse/lib/mini_sql_multisite_connection.rb:105:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_sql-1.6.0/lib/mini_sql/postgres/connection.rb:196:in `exec'
/var/www/discourse/plugins/discourse-ai/db/migrate/20250110114305_embedding_config_data_migration.rb:174:in `persist_config'
/var/www/discourse/plugins/discourse-ai/db/migrate/20250110114305_embedding_config_data_migration.rb:15:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:997:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:997:in `exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/benchmark-0.4.0/lib/benchmark.rb:304:in `measure'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:978:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/benchmark-0.4.0/lib/benchmark.rb:304:in `measure'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:977:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:415:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:976:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1190:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1538:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1589:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1537:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1512:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1512:in `migrate_without_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1457:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1609:in `with_advisory_lock'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1457:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1264:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/migration.rb:1239:in `migrate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/var/www/discourse/lib/tasks/db.rake:259:in `block (2 levels) in <main>'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/lib/tasks/db.rake:234:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

Causé par :
TypeError : impossible de citer un Array (TypeError)

        else raise TypeError, "can't quote #{value.class.name}"
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:87:in `quote'

En coupant un peu ici

/var/www/discourse/lib/tasks/db.rake:259:in `block (2 levels) in <main>'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/lib/tasks/db.rake:234:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(Voir la trace complète en exécutant la tâche avec --trace)
I, [2025-01-21T18:15:31.095368 #1]  INFO -- : gem install tokenizers -v 0.4.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tokenizers-0.4.4-x86_64-linux
1 gem installed
gem install tiktoken_ruby -v 0.0.9 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tiktoken_ruby-0.0.9-x86_64-linux
1 gem installed
gem install ed25519 -v 1.2.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Building native extensions. This could take a while...
Successfully installed ed25519-1.2.4
1 gem installed
== 20250110114305 EmbeddingConfigDataMigration: migrating =====================

I, [2025-01-21T18:15:31.095913 #1]  INFO -- : Terminating async processes
I, [2025-01-21T18:15:31.095985 #1]  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/13/bin/postmaster -D /etc/postgresql/13/main pid: 39
2025-01-21 18:15:31.096 UTC [39] LOG:  received fast shutdown request
I, [2025-01-21T18:15:31.096312 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 107
107:signal-handler (1737483331) Received SIGTERM scheduling shutdown...

Quelque chose ne va pas ici ?

1 « J'aime »

Oui, je viens de désactiver discourse-ai et l’instance est de nouveau opérationnelle. Idiot que je n’aie pas repéré cette ligne d’erreur avant :man_facepalming:

Avez-vous eu une configuration inhabituelle sur votre modèle d’intégration ?

cc @roman

1 « J'aime »

Pas que je sache. Comment confirmer ? J’utilise à peu près la configuration de base.