Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to publish to private Nexus repo using 'poetry publish -r nexus' #3053

Closed
3 tasks done
rudolfsberzins opened this issue Oct 2, 2020 · 2 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues

Comments

@rudolfsberzins
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

My company has a custom Nexus server for distributing internal Python packages.
Starting from today the bitbucket-pipelines.yml we use starts to fail when trying to publish a package using poetry.

I have deduced that the error arose from the update to version 1.1.0 because if I downgrade back to 1.0.10 the pipeline completes and can upload package to server.

Command sequence

> poetry build
> poetry config repositories.nexus https://nexus.COMPANYNAME.io/repository/pypi-internal/
> poetry config http-basic.nexus $NEXUS_WRITE_USERNAME $NEXUS_WRITE_PASSWORD
> poetry publish -r nexus

Expected Outcome
I can still do this with version 1.0.10

> poetry publish -r nexus
Publishing ma_aws_tools (1.0.1) to nexus
 - Uploading ma_aws_tools-1.0.1-py3-none-any.whl 100%
 - Uploading ma_aws_tools-1.0.1.tar.gz 100%

Actual Outcome

>poetry publish -r nexus
Publishing ma_aws_tools (1.0.1) to nexus
 - Uploading ma_aws_tools-1.0.1-py3-none-any.whl 100%

  UploadError

  HTTP Error 404: Not Found

  at ~/.poetry/lib/poetry/publishing/uploader.py:216 in _upload
      212│                     self._register(session, url)
      213│                 except HTTPError as e:
      214│                     raise UploadError(e)
      215│
    → 216│             raise UploadError(e)
      217│
      218│     def _do_upload(
      219│         self, session, url, dry_run=False
      220│     ):  # type: (requests.Session, str, Optional[bool]) -> None

Full stack trace with '-vvv'

Publishing ma_aws_tools (1.0.1) to nexus
 - Uploading ma_aws_tools-1.0.1-py3-none-any.whl 100%

  Stack trace:

  7  ~/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py:131 in run
      129│             parsed_args = resolved_command.args
      130│
    → 131│             status_code = command.handle(parsed_args, io)
      132│         except KeyboardInterrupt:
      133│             status_code = 1

  6  ~/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py:120 in handle
      118│     def handle(self, args, io):  # type: (Args, IO) -> int
      119│         try:
    → 120│             status_code = self._do_handle(args, io)
      121│         except KeyboardInterrupt:
      122│             if io.is_debug():

  5  ~/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py:171 in _do_handle
      169│         handler_method = self._config.handler_method
      170│
    → 171│         return getattr(handler, handler_method)(args, io, self)
      172│
      173│     def __repr__(self):  # type: () -> str

  4  ~/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py:92 in wrap_handle
       90│         self._command = command
       91│
    →  92│         return self.handle()
       93│
       94│     def handle(self):  # type: () -> Optional[int]

  3  ~/.poetry/lib/poetry/console/commands/publish.py:83 in handle
      81│             cert,
      82│             client_cert,
    → 83│             self.option("dry-run"),
      84│         )
      85│

  2  ~/.poetry/lib/poetry/publishing/publisher.py:97 in publish
      95│             cert=cert or get_cert(self._poetry.config, repository_name),
      96│             client_cert=resolved_client_cert,
    → 97│             dry_run=dry_run,
      98│         )
      99│

  1  ~/.poetry/lib/poetry/publishing/uploader.py:119 in upload
      117│
      118│         try:
    → 119│             self._upload(session, url, dry_run)
      120│         finally:
      121│             session.close()

  UploadError

  HTTP Error 404: Not Found

  at ~/.poetry/lib/poetry/publishing/uploader.py:216 in _upload
      212│                     self._register(session, url)
      213│                 except HTTPError as e:
      214│                     raise UploadError(e)
      215│
    → 216│             raise UploadError(e)
      217│
      218│     def _do_upload(
      219│         self, session, url, dry_run=False
      220│     ):  # type: (requests.Session, str, Optional[bool]) -> None

Temporary Solution

> poetry self update 1.0.10
> poetry build
> poetry config repositories.nexus https://nexus.COMPANYNAME.io/repository/pypi-internal/
> poetry config http-basic.nexus $NEXUS_WRITE_USERNAME $NEXUS_WRITE_PASSWORD
> poetry publish -r nexus
@rudolfsberzins rudolfsberzins added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 2, 2020
@abn
Copy link
Member

abn commented Oct 2, 2020

Duplicate of #3052

@abn abn marked this as a duplicate of #3052 Oct 2, 2020
@abn abn added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged labels Oct 2, 2020
@abn abn closed this as completed Oct 2, 2020
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

2 participants