Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

[bug] update: exits 0 after the upgrade actually failed

Aberta Para iniciantes
#242 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript
Domínio
cli

Direção de pesquisa

Comece pelo caminho de falha de bl update que exibe “Automatic update failed”; a issue não indica nenhum arquivo-fonte nem teste. Acompanhe como esse ramo trata a falha do npm e o status de saída do processo; em seguida, execute os testes de atualização relevantes ou reproduza o problema com um prefixo global do npm somente para leitura. O objetivo é que uma atualização malsucedida retorne um código diferente de zero, enquanto uma atualização bem-sucedida continue tendo sucesso.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Environment

  • CLI: bl 2.0.1 at the time of failure (Skill: 2.0.1)
  • Node: v22.23.3
  • OS: Linux 5.15.0-198-generic x86_64 (Ubuntu)
  • Install channel: npm global (npm prefix -g → /home/lin/.npm-global)
  • Region: cn (domestic)

Reproduce

  1. Install bl globally via npm.
  2. Make the npm global prefix read-only (here: a read-only filesystem sandbox).
  3. With a newer version available (2.0.1 → 2.1.0), run:
bl update; echo "exit=$?"

Expected

A failed upgrade exits non-zero.

Actual

The upgrade failed with EROFS, the CLI printed Automatic update failed. Please run manually: — and still exited 0.

Any driver that checks only the exit code (CI, cron, agent) will record the
upgrade as successful while the old version is still installed. In this case the
caller believed 2.0.1 was the latest until it re-read bl --version.

Full output

Current version: 2.0.1
Install method: npm
Checking for updates...
Latest version: 2.1.0

Updating bailian-cli via npm...

npm error code EROFS
npm error syscall rename
npm error path /home/lin/.npm-global/lib/node_modules/bailian-cli
npm error dest /home/lin/.npm-global/lib/node_modules/.bailian-cli-RC0fMVNr
npm error errno -30
npm error rofs EROFS: read-only file system, rename '/home/lin/.npm-global/lib/node_modules/bailian-cli' -> '/home/lin/.npm-global/lib/node_modules/.bailian-cli-RC0fMVNr'
npm error rofs Often virtualized file systems, or other file systems
npm error rofs that don't support symlinks, give this error.
npm error A complete log of this run can be found in: <npm debug log>

Automatic update failed. Please run manually:
  npm install -g bailian-cli@latest
exit=0

Already tried

  • Confirmed the exit code with both echo $? and ${PIPESTATUS[0]} — both 0
  • The failure is not shell-related: bl update itself returns 0
  • Same behaviour regardless of whether npm's cache/logs directories are writable
  • After granting write access, the retry succeeded (2.0.1 → 2.1.0) and printed
    the skill-update result normally — so only the failure branch reports success

Notes

  • Frequency: always on the failure path
  • Related: #229 reports --config <profile> also exiting 0 on failure
    (exits 0 unauthenticated). Same class of defect: the process exit code does
    not reflect the outcome, and the CLI's own documented contract treats exit 0 as
    SUCCESS.
  • Suggested fix: propagate npm's exit code from the bl update failure branch
    (or return a dedicated non-zero code), so bl update && ... and agent drivers
    can detect the failure.
Linguagem predominante
TypeScript
Estrelas
540
Forks
35
Merge médio
6h 43min
PRs com merge (30d)
23

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de modelstudioai/cli

Todas as issues de modelstudioai/cli

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.