Falha na reconstrução devido à incompatibilidade de gemas ruby

Nota: Chamei meu contêiner de containers/polyf.yml
O discourse-doctor não lida com isso de forma alguma…

$ ./launcher rebuild polyf
...
I, [2023-04-06T09:50:45.464717 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'
[DEPRECATED] A flag `--deployment` está obsoleta porque depende de ser lembrada entre invocações do bundler, o que o bundler não fará mais em versões futuras. Em vez disso, use `bundle config set --local deployment 'true'`, e pare de usar esta flag
[DEPRECATED] A flag `--without` está obsoleta porque depende de ser lembrada entre invocações do bundler, o que o bundler não fará mais em versões futuras. Em vez disso, use `bundle config set --local without 'test development'`, e pare de usar esta flag
Bundler::PathError: O caminho `/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/sprockets-f4d3dae71ef2` não existe.
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/path.rb:209:in `load_spec_files'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/git.rb:205:in `load_spec_files'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/path.rb:107:in `local_specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/source/git.rb:172:in `specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/lazy_specification.rb:82:in `materialize_for_installation'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:195:in `map!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:195:in `specs_for_dependency'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:33:in `block in for'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:22:in `loop'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:22:in `for'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:79:in `materialize'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/definition.rb:209:in `missing_specs'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/definition.rb:213:in `missing_specs?'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:255:in `resolve_if_needed'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:82:in `block in run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `open'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:71:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:23:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli/install.rb:62:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:260:in `block in install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/settings.rb:131:in `temporary'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:259:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:34:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:28:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:45:in `block in <top (required)>'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:33:in `<top (required)>'
  /usr/local/bin/bundle:25:in `load'
  /usr/local/bin/bundle:25:in `<main>'
Bundler::InstallError: sass-embedded-1.60.0-x86_64-linux requer a versão do rubygems >= 3.3.22, que é incompatível com a versão atual, 3.3.20
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:237:in `block in ensure_specs_are_compatible!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:155:in `each'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/spec_set.rb:155:in `each'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:231:in `ensure_specs_are_compatible!'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:83:in `block in run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:12:in `block in lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `open'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/process_lock.rb:9:in `lock'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:71:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/installer.rb:23:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli/install.rb:62:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:260:in `block in install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/settings.rb:131:in `temporary'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:259:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:34:in `dispatch'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/cli.rb:28:in `start'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:45:in `block in <top (required)>'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.4.4/exe/bundle:33:in `<top (required)>'
  /usr/local/bin/bundle:25:in `load'
  /usr/local/bin/bundle:25:in `<main>'
I, [2023-04-06T09:50:56.916061 #1]  INFO -- : Executando `bundle install --deployment --jobs 4 --retry 3 --verbose --without "test" "development"` com bundler 2.4.4
Congelado, usando resolução do lockfile
A definição está faltando dependências, falhou ao resolver e materializar localmente (https://github.com/rails/sprockets (em 3.x@f4d3dae) ainda não foi descompactado. Execute `bundle install` primeiro.)
Congelado, usando resolução do lockfile
...
2023-04-06 09:50:56.935 UTC [47] LOG:  desligando
2023-04-06 09:50:56.970 UTC [43] LOG:  sistema de banco de dados desligado
104:M 06 Apr 2023 09:50:57.012 # Usuário solicitou desligamento...
104:M 06 Apr 2023 09:50:57.012 * Salvando o snapshot RDB final antes de sair.
104:M 06 Apr 2023 09:50:57.036 * DB salvo em disco
104:M 06 Apr 2023 09:50:57.036 # Redis está pronto para sair, tchau tchau...


FALHOU
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' falhou com retorno #<Process::Status: pid 367 exit 5>
Local da falha: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec falhou com os parâmetros {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'"]}
bootstrap falhou com código de saída 5
** FALHA AO INICIALIZAR ** por favor, role para cima e procure por mensagens de erro anteriores, pode haver mais de uma.
./discourse-doctor pode ajudar a diagnosticar o problema.
82f1cada0a0c138a0834f1682f3475590d0e28f179b243c4f0d54ae7043515bb

De alguma forma você tem ruby 2.7.0 onde eu tenho ruby 3.2.0. Talvez você possa mostrar seu log completo - algo falhou em ser atualizado. A sequência usual é

cd /var/discourse
git pull
./launcher rebuild app

(embora no seu caso, não app, mas polyf)

Em um tópico próximo:

4 curtidas

Eu rodo Debian [stable] (atualmente é a versão 11, codinome bullseye), para a qual o pacote ruby padrão é a versão 2.7.0: Debian -- Details of package ruby in bullseye

Fico um pouco surpreso que git pull seja necessário, considerando que ./launcher já faz isso na reconstrução:

No entanto, estou tentando com um git pull anterior agora, que obteve algumas modificações, então não tenho certeza se entendi por que o launcher obteve essas… Bem, verei como vai e voltarei a falar com você.

1 curtida

Acho que é a versão do Ruby dentro do contêiner Docker que conta, e isso realmente deveria estar certo se a imagem foi atualizada como deveria ter sido. Se você estiver executando algo diferente de tests-passed, sua imagem pode ser mais antiga, caso em que o problema pode ser uma incompatibilidade com um plugin que é muito novo. Nesse caso, comentar seus plugins pode reduzir qual deles é incompatível com seu Discourse intencionalmente antigo.

3 curtidas

Talvez você esteja em um estado git “sujo” ou no branch master antigo?

2 curtidas

Com o ‘git pull’, a reconstrução funcionou perfeitamente.

@Falco, eu estava de fato no antigo branch master. Agora estou no novo branch main… Não consigo dizer exatamente onde isso aconteceu, é bem possível que uma nova execução do launcher tenha feito isso nos bastidores (vejo algum código lá que faz a troca se você estiver no master).

Ah bem, chamarei este upgrade de “mágica” e não me importarei além disso, pois agora, minha instância do discourse está feliz e funcionando.

Obrigado pelo apoio (moral, se nada mais), pessoal!

2 curtidas

Um ponto de dados, aliás, é que fiz o upgrade da versão 2.9.0.beta9. Talvez isso faça alguma diferença…

1 curtida

Acho que isso nos diz do que se trata o git pull - ele atualiza o próprio launcher, antes de você executá-lo. Eu não sabia disso.

1 curtida

@JammyDodger, obrigado. Eu ainda não tinha descoberto o botão "Solução".

[toma nota]

1 curtida

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