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

Promotion Success / Process Failed #276

Open
darkfrog26 opened this issue Dec 30, 2021 · 19 comments
Open

Promotion Success / Process Failed #276

darkfrog26 opened this issue Dec 30, 2021 · 19 comments

Comments

@darkfrog26
Copy link

darkfrog26 commented Dec 30, 2021

Describe the bug
After I get the message "The promote stage is in progress", it starts showing:
Execution failed: [404: Not Found] Request failed: {"errors":[{"id":"*","msg":"No activity for repository: comoutr-1003"}]}. Retrying in 15.00 sec. - (SonatypeClient.scala:172)

Perpetually. It would appear as though the promotion was successful, but the plugin never finishes because it just keeps getting the "No activity" response.

How to reproduce the issue
It doesn't always happen, but it is frequently happening ever since I migrated to "https://s01.oss.sonatype.org/service/local"

  • sbt version: 1.6.1
  • sbt-sonatype version: 3.9.10
  • Show your build settings:
$ sbt
> sonatypeProfileName
com.outr
> sonatypeRepository
https://s01.oss.sonatype.org/service/local

Additional context
Just released 3.6.6 and it happened with it, but I believe it was successfully released.

@mkurz
Copy link

mkurz commented Jan 4, 2022

More people experienced this: sbt/sbt-ci-release#223

@xerial
Copy link
Owner

xerial commented Feb 11, 2022

I think we need to confirm two things:

Unfortunately, I don't have any s01 sonatype account, so help for confirming these two points is appreciated.

@pomadchin
Copy link

pomadchin commented Feb 11, 2022

@pomadchin
Copy link

pomadchin commented Feb 11, 2022

I had a chance to look into it a bit: 3.9.7...3.9.11
The only suspisious PR in this list is #242

There is indeed a regression introduced in terms of #242, which is solved now by having a ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" defined in the build.sbt file.

TlDR; the per project sonatypeCredentialHost settings gets overrided(?) (or gets wrognly picked up) and is not enough to have, that should be set globally only.

A tiny proof with the green release.

I am not sure if that is a desired behavior.

P.S. snapshots were published fine even with out the globally set sonatypeCredentialHost.

And theoretically that could be not directly #242, but smth around as well.

@xerial
Copy link
Owner

xerial commented Feb 14, 2022

@pomadchin Thanks.

It seems @darkfrog26 also has this setting, but experiencing the same error occasionally:

ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"

To identify the cause, adding some info log to see which repository URLs are actually used around here would be the next step:

val repositoryUrl = extracted.get(sonatypeRepository)
val creds = getCredentials(extracted, state)
val credentialHost = extracted.get(sonatypeCredentialHost)

@pomadchin
Copy link

@xerial hmmm the only difference with my build is that I have it set both per project and globally ._.' what a tricky behavior to debug.

@xerial
Copy link
Owner

xerial commented Feb 16, 2022

It looks like the issue of configuration scopes. I guess depending on the context within sbt, extracting project settings via Project.extract(state) references unexpected projects.

val extracted = Project.extract(state)

An approach would be changing sonatypeXXX commands into an sbt task definition or finding a way to get a consistent reference to the root project when calling Project.extract(state)

@xerial
Copy link
Owner

xerial commented Feb 17, 2022

Probably I've found the cause:

sonatypeRepository := s"https://${sonatypeCredentialHost.value}/service/local",

This setting is not referencing ThisBuild / sonatypeCredentialHost, so the setting might vary depending on the context project. If that's the case, your log might show in the failed deployment:

 info [SonatypeService] sonatypeRepository  : https://oss.sonatype.org/service/local

If s01.oss.sonatype.org is set in sonatypeCredentialHost, the url should be https://s01.oss.sonatype.org/service/local

@darkfrog26
Copy link
Author

@xerial, awesome! When will this be released?

xerial added a commit that referenced this issue Feb 17, 2022
* Use ThisBuild / sonatypeXXX settings within commands

* reformat

* cleanup

* Cleanup

* cleanup
@xerial
Copy link
Owner

xerial commented Feb 18, 2022

Released sbt-sonatype 3.9.12 with a fix in #285. I'm not sure this will solve the problem, but let me know if you still experience the issue.

@pomadchin
Copy link

@xerial thank you, this is great! I won't be able to check it immediately sadly 🤦 I have only one package that is shipped via the fresh sonatype repo. Until the next release than (will try to do it as soon as its possible to cut one).

@darkfrog26
Copy link
Author

All of my open-source projects are now on s01, so I'll drop a message if I see this again. Thanks, @xerial!

@armanbilge
Copy link
Contributor

armanbilge commented Feb 19, 2022

Hi, I appreciate all the effort to improve experience for publishing to s01 :)

Unfortunately, the changes in #285 are not backwards compatible and will break all of our existing builds publishing to s01 using sbt-typelevel.

[MISSING_CREDENTIAL] No credential is found for oss.sonatype.org. Prepare ~/.sbt/(sbt_version)/sonatype.sbt file.
	at xerial.sbt.sonatype.SonatypeClient.$anonfun$directCredentials$1(SonatypeClient.scala:45)
	at scala.Option.getOrElse(Option.scala:189)
	at xerial.sbt.sonatype.SonatypeClient.directCredentials$lzycompute(SonatypeClient.scala:43)
	at xerial.sbt.sonatype.SonatypeClient.directCredentials(SonatypeClient.scala:39)
	at xerial.sbt.sonatype.SonatypeClient.<init>(SonatypeClient.scala:52)
	at xerial.sbt.Sonatype$.withSonatypeService(Sonatype.scala:432)
	at xerial.sbt.Sonatype$.$anonfun$sonatypeBundleRelease$1(Sonatype.scala:177)
	at sbt.Command$.$anonfun$command$2(Command.scala:97)
	at sbt.Command$.process(Command.scala:189)
	at org.typelevel.sbt.TypelevelSonatypePlugin$.$anonfun$sonatypeBundleReleaseIfRelevant$1(TypelevelSonatypePlugin.scala:88)
[error] [MISSING_CREDENTIAL] No credential is found for oss.sonatype.org. Prepare ~/.sbt/(sbt_version)/sonatype.sbt file.

@armanbilge
Copy link
Contributor

armanbilge commented Feb 19, 2022

For the record, I have also experienced the problem originally reported in this issue (for example in typelevel/sbt-typelevel#84 (comment)). However, I have seen it on the legacy host (not s01) and every time it has happened the release has always completed successfully anyway.

So IMHO I don't think this is related at all to the credential host.

@simao
Copy link

simao commented Feb 24, 2022

I am getting the same problem since I upgraded to 3.9.12:

[MISSING_CREDENTIAL] No credential is found for oss.sonatype.org. Prepare ~/.sbt/(sbt_version)/sonatype.sbt file.

Thanks

@xerial
Copy link
Owner

xerial commented Feb 28, 2022

We need to release a new version, which fixes this regression. Use sbt-sonatype 3.9.11 for a while. I'm a bit busy this week

@albuch
Copy link

albuch commented Mar 9, 2022

I still get the original error of this issue (error after promotion) with v3.9.12. It seems it breaks for legacy users of oss.sonatype.org who don't even have the ssetting in their build?
My build configuration: https://github.com/albuch/sbt-dependency-check/blob/main/build.sbt

@xerial
Copy link
Owner

xerial commented May 24, 2022

Released sbt-sonatype 3.9.13, which reverted #276.

@xerial
Copy link
Owner

xerial commented Feb 4, 2023

This issue is related to #309

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

7 participants