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

Composer repository no longer updates composer2 JSON files for new versions in case if redeploys are not allowed #135

Open
mamazik opened this issue Feb 14, 2023 · 2 comments

Comments

@mamazik
Copy link

mamazik commented Feb 14, 2023

What are you trying to do?

Hello!

We use Nexus 3.42.0 with nexus-repository-composer 0.0.29. Our dev team uses it to upload packages (on each upload version is incremented), and we noticed that packages uploaded after 15.10.2022 would no longer be reflected specifically in composer2-related JSON files.

In other words, for all such packages we would see all of their versions here:
https://nexus.example.com/repository/composer-hosted/p/my/package.json

But not here:
https://nexus.example.com/repository/composer-hosted/p2/my/package.json

When I tried to reproduce the issue manually (which I was able to do easily) with cURL, I noticed that every upload of a new version logs the following error to nexus.log (not going to copy the whole stack trace, but let me please know if you need to see it!):

"Repository does not allow updating assets: composer-hosted"

When I attempted to enable redeploys for the repo, the issue disappeared, so it's seems as if Nexus believes that we're uploading the same version over and over, which's not the case.

On example of one of such packages we know that it started misbehaving around 15.10.2022 or so. Last time we updated Nexus and the plugin was on 30.09.2022, but after that there were at least a few "proper" uploads, so we're really curious as to what could be the cause.

What feature or behavior is this required for?
Publishing Composer packages.

How could we solve this issue? (Not knowing is okay!)
I thought I should check this with you guys first, although I'm pretty sure it's an issue/bug with Nexus itself. Perhaps you know what could be the issue?

Anything else?
I noticed Nexus does have a somewhat similar bug, which's still not resolved.

@mamazik
Copy link
Author

mamazik commented Mar 9, 2023

Hello!

Any updates please?

@riubi
Copy link

riubi commented Jul 9, 2024

I faced the same problem. The bug is that %package%.json for p2 is considered part of the build, and if the "Forbid redeploy" option is set, the plugin throws an IllegalOperationException. As a solution, set the Deployment policy to "Allow redeploy." In this case, the exception doesn't appear, and the meta for v2 is generated without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants