question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return a non-zero exit code when publishing to a repository fails

See original GitHub issue

Context: Using Poetry in Build (CI/CD) systems. While using Poetry to upload a wheel file to Sonatype Nexus repository, Repository throws a 400 error if the wheel file with the same version is already available in the repository.

Example: poetry publish $private_nexus_url --build

  1. Builds a wheel file my_wheel_file_0.1.0
  2. Uploads the wheel file to Nexus Repository => Version on Nexus: my_wheel_file_0.1.0

Run again without updating the version, i.e the project’s version is still 0.1.0 poetry publish $private_nexus_url --build

  1. Builds a wheel file my_wheel_file_0.0.1
  2. Tries to upload the wheel file my_wheel_file_0.0.1 to Nexus Repository and returns an error message.
  3. “poetry publish” fails silently by displaying the error message.

Error message:

[HTTPError]                                                      
 400 Client Error: Repository does not allow updating assets: pypi-internal
 or url: <private repository url>   

Improvement/Bug: In the context of CI/CD systems, a non-zero exit code along with error message is required else the build systems fail silently without uploading the latest artifact. Exit with a non zero code along with error message

Note: We could configure Nexus to allow republishing the same artifact version again.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Rogercommented, Oct 3, 2018

Publishing with wrong credentials ends up in the same behavior

0reactions
sdispatercommented, Apr 11, 2019

Version 0.12.12 has just been released!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does 'nonzero return code 128' in github actions mean?
If there are no tags it can use, then Git will exit with status code 128 so that users can easily detect that...
Read more >
Build failed due to a user error: Build script returned non-zero ...
Hello , I'm facing this issue Build failed due to a user error: Build script returned non-zero exit code: 2. and I can't...
Read more >
Configuring CircleCI
By default, CircleCI will execute job steps one at a time, in the order that they are defined in config.yml , until a...
Read more >
Upon browsing a specific repo, an "500 exited with code 0 ...
The error is caused by a missing .gitmodules file that git could not find for some reason. When a repo with submodules is...
Read more >
Steps - drone docs
The root of your git repository, also called the workspace, is shared by all ... If a command returns a non-zero exit code,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found