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

ERROR: Staging repository is not in desired state |closed| #106

Closed
nhajratw opened this issue Jun 7, 2021 · 8 comments
Closed

ERROR: Staging repository is not in desired state |closed| #106

nhajratw opened this issue Jun 7, 2021 · 8 comments

Comments

@nhajratw
Copy link
Contributor

nhajratw commented Jun 7, 2021

Running ./gradlew publishToSonatype closeSonatypeStagingRepository --info results in the following error:

Initialized native services in: /Users/nhajrat3/.gradle/nativecloseSonatypeStagingRepository --info
The client will now receive all logging from the daemon (pid: 9134). The daemon log file: /Users/nhajrat3/.gradle/daemon/7.0.2/daemon-9134.out.log
Starting 6th build in daemon ijuptime: 48 mins 44.974 secs, performance: 100%, non-heap usage: 50% of 256 MiB|
Using 6 worker leases.
Now considering ij/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support| as hierarchies to watch
Watching the file system is enabled
Starting Build
Settings evaluated using settings file '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/settings.gradle.kts'.
Using local directory build cache for the root build (location = /Users/nhajrat3/.gradle/caches/build-cache-1, removeUnusedEntriesAfter = 7 days).
Projects loaded. Root project using build file '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/build.gradle.kts'.
Included projects: ijroot project 'spring-rxtx-test-support', project ':lib'|

> Configure project :
Evaluating root project 'spring-rxtx-test-support' using build file '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/build.gradle.kts'.
Build cache key for Kotlin DSL plugin accessors for classpath '4318a89f5bf2c7a014026ed3447986ec' is 26a688ef230cdf94221463cbf37ffe9c
Skipping Kotlin DSL plugin accessors for classpath '4318a89f5bf2c7a014026ed3447986ec' as it is up-to-date.
Build cache key for Kotlin DSL script compilation (Project/TopLevel/stage1) is 58c239badb7c8a2437ab868e4e5adccb
Kotlin DSL script compilation (Project/TopLevel/stage1) is not up-to-date because:
  No history is available.
Stored cache entry for Kotlin DSL script compilation (Project/TopLevel/stage1) with cache key 58c239badb7c8a2437ab868e4e5adccb
kotlin scripting plugin: created the scripting discovery configuration: kotlinScriptDef
kotlin scripting plugin: created the scripting discovery configuration: testKotlinScriptDef
Applying dependency management to configuration 'annotationProcessor' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'api' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'apiDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'apiElements' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'archives' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'compileClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'compileOnly' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'compileOnlyDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'default' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'detekt' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'detektPlugins' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'implementation' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'implementationDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinCompilerClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinCompilerPluginClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinCompilerPluginClasspathMain' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinCompilerPluginClasspathTest' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinKlibCommonizerClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinNativeCompilerPluginClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinScriptDef' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'kotlinScriptDefExtensions' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'runtimeClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'runtimeElements' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'runtimeOnly' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'runtimeOnlyDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'sourceArtifacts' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testApi' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testApiDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testCompileClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testCompileOnly' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testCompileOnlyDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testImplementation' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testImplementationDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testKotlinScriptDef' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testKotlinScriptDefExtensions' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testRuntimeOnly' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'testRuntimeOnlyDependenciesMetadata' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'compileOnlyApi' in project 'spring-rxtx-test-support'
Build cache key for Kotlin DSL accessors for root project 'spring-rxtx-test-support' is ab53b93462ef4bab0e8f93969bacded5
Skipping Kotlin DSL accessors for root project 'spring-rxtx-test-support' as it is up-to-date.
Build cache key for Kotlin DSL script compilation (Project/TopLevel/stage2) is 80e5a7dd0d2df3300f2a677a8bad83e3
Kotlin DSL script compilation (Project/TopLevel/stage2) is not up-to-date because:
  No history is available.
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/nhajrat3/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/lib/kotlin-stdlib-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/lib/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/lib/kotlin-stdlib-jdk7-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/lib/kotlin-stdlib-jdk8-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2/lib/kotlin-reflect-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/caches/jars-8/2c0fe1e685e18554f37d9bd6d6701500/kotlin-reflect-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/caches/jars-8/02fd7d756865bd5f1bbe08ed9ce06e11/kotlin-stdlib-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/caches/jars-8/d8e8119e37c2be52e496c7534179735f/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /Users/nhajrat3/.gradle/caches/jars-8/9c98351759eb31050d8e6f82ed86c91e/kotlin-script-runtime-1.5.10.jar (version 1.5)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Stored cache entry for Kotlin DSL script compilation (Project/TopLevel/stage2) with cache key 80e5a7dd0d2df3300f2a677a8bad83e3
Applying dependency management to configuration 'apiElements-published' in project 'spring-rxtx-test-support'
Applying dependency management to configuration 'runtimeElements-published' in project 'spring-rxtx-test-support'

> Configure project :lib
Evaluating project ':lib' using build file '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/lib/build.gradle'.
All projects evaluated.
Selected primary task 'publishToSonatype' from project :
Starting process 'command '/usr/libexec/java_home''. Working directory: /Users/nhajrat3/.gradle/daemon/7.0.2 Command: /usr/libexec/java_home -V
Successfully started process 'command '/usr/libexec/java_home''
Resolving global dependency management for project 'spring-rxtx-test-support'
Excluding ij|
Selected primary task 'closeSonatypeStagingRepository' from project :
Tasks to be executed: ijtask ':compileKotlin', task ':compileJava', task ':processResources', task ':classes', task ':inspectClassesForKotlinIC', task ':jar', task ':generateMetadataFileForMavenJavaPublication', task ':generatePomFileForMavenJavaPublication', task ':initializeSonatypeStagingRepository', task ':publishMavenJavaPublicationToSonatypeRepository', task ':publishToSonatype', task ':closeSonatypeStagingRepository'|
Tasks that were excluded: ij|
:compileKotlin (ThreadijExecution worker for ':',5,main|) started.

> Task :compileKotlin UP-TO-DATE
Excluding ij|
Excluding ij|
Build cache key for task ':compileKotlin' is a949c31c3c1ffc3c7b7761172294f471
Skipping task ':compileKotlin' as it is up-to-date.
:compileKotlin (ThreadijExecution worker for ':',5,main|) completed. Took 0.216 secs.
:compileJava (ThreadijExecution worker for ':',5,main|) started.

> Task :compileJava NO-SOURCE
file or directory '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/src/main/java', not found
Skipping task ':compileJava' as it has no source files and no previous output files.
:compileJava (ThreadijExecution worker for ':',5,main|) completed. Took 0.0 secs.
:processResources (ThreadijExecution worker for ':',5,main|) started.

> Task :processResources NO-SOURCE
Skipping task ':processResources' as it has no source files and no previous output files.
:processResources (ThreadijExecution worker for ':',5,main|) completed. Took 0.0 secs.
:classes (ThreadijExecution worker for ':',5,main|) started.

> Task :classes UP-TO-DATE
Skipping task ':classes' as it has no actions.
:classes (ThreadijExecution worker for ':',5,main|) completed. Took 0.0 secs.
:inspectClassesForKotlinIC (ThreadijExecution worker for ':',5,main|) started.

> Task :inspectClassesForKotlinIC UP-TO-DATE
Caching disabled for task ':inspectClassesForKotlinIC' because:
  Caching has not been enabled for the task
Skipping task ':inspectClassesForKotlinIC' as it is up-to-date.
:inspectClassesForKotlinIC (ThreadijExecution worker for ':',5,main|) completed. Took 0.002 secs.
:jar (ThreadijExecution worker for ':',5,main|) started.

> Task :jar UP-TO-DATE
file or directory '/Users/nhajrat3/IdeaProjects/spring-rxtx-test-support/build/classes/java/main', not found
Caching disabled for task ':jar' because:
  Caching has not been enabled for the task
Skipping task ':jar' as it is up-to-date.
:jar (ThreadijExecution worker for ':',5,main|) completed. Took 0.008 secs.
:generateMetadataFileForMavenJavaPublication (ThreadijExecution worker for ':',5,main|) started.

> Task :generateMetadataFileForMavenJavaPublication
Caching disabled for task ':generateMetadataFileForMavenJavaPublication' because:
  Caching has not been enabled for the task
Task ':generateMetadataFileForMavenJavaPublication' is not up-to-date because:
  Task.upToDateWhen is false.
:generateMetadataFileForMavenJavaPublication (ThreadijExecution worker for ':',5,main|) completed. Took 0.002 secs.
:generatePomFileForMavenJavaPublication (ThreadijExecution worker for ':',5,main|) started.

> Task :generatePomFileForMavenJavaPublication
Caching disabled for task ':generatePomFileForMavenJavaPublication' because:
  Caching has not been enabled for the task
Task ':generatePomFileForMavenJavaPublication' is not up-to-date because:
  Task.upToDateWhen is false.
Excluding ij|
:generatePomFileForMavenJavaPublication (ThreadijExecution worker for ':',5,main|) completed. Took 0.082 secs.
:initializeSonatypeStagingRepository (ThreadijExecution worker for ':',5,main|) started.

> Task :initializeSonatypeStagingRepository
Caching disabled for task ':initializeSonatypeStagingRepository' because:
  Caching has not been enabled for the task
Task ':initializeSonatypeStagingRepository' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
No stagingProfileId set, querying for packageGroup 'com.chikli.spring'
Creating staging repository for sonatype at https://s01.oss.sonatype.org/service/local/, stagingProfileId '23aa10bb2c57fa'
Created staging repository 'comchikli-1005' at https://s01.oss.sonatype.org/service/local/repositories/comchikli-1005/content/
:initializeSonatypeStagingRepository (ThreadijExecution worker for ':',5,main|) completed. Took 3.867 secs.
:publishMavenJavaPublicationToSonatypeRepository (ThreadijExecution worker for ':',5,main|) started.

> Task :publishMavenJavaPublicationToSonatypeRepository
Custom actions are attached to task ':publishMavenJavaPublicationToSonatypeRepository'.
Caching disabled for task ':publishMavenJavaPublicationToSonatypeRepository' because:
  Caching has not been enabled for the task
Task ':publishMavenJavaPublicationToSonatypeRepository' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Uploading to https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/comchikli-1005
Publishing to repository 'sonatype' (https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/comchikli-1005)
Uploading spring-rxtx-test-support-1.0.0.jar to /service/local/staging/deployByRepositoryId/comchikli-1005/com/chikli/spring/spring-rxtx-test-support/1.0.0/spring-rxtx-test-support-1.0.0.jar
Uploading spring-rxtx-test-support-1.0.0.pom to /service/local/staging/deployByRepositoryId/comchikli-1005/com/chikli/spring/spring-rxtx-test-support/1.0.0/spring-rxtx-test-support-1.0.0.pom
Uploading spring-rxtx-test-support-1.0.0.module to /service/local/staging/deployByRepositoryId/comchikli-1005/com/chikli/spring/spring-rxtx-test-support/1.0.0/spring-rxtx-test-support-1.0.0.module
Resource missing. ijHTTP GET: https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/comchikli-1005/com/chikli/spring/spring-rxtx-test-support/maven-metadata.xml|
Uploading maven-metadata.xml to /service/local/staging/deployByRepositoryId/comchikli-1005/com/chikli/spring/spring-rxtx-test-support/maven-metadata.xml
:publishMavenJavaPublicationToSonatypeRepository (ThreadijExecution worker for ':',5,main|) completed. Took 1.593 secs.
:publishToSonatype (ThreadijExecution worker for ':',5,main|) started.

> Task :publishToSonatype
Skipping task ':publishToSonatype' as it has no actions.
:publishToSonatype (ThreadijExecution worker for ':',5,main|) completed. Took 0.0 secs.
:closeSonatypeStagingRepository (ThreadijExecution worker for ':',5,main|) started.

> Task :closeSonatypeStagingRepository
Caching disabled for task ':closeSonatypeStagingRepository' because:
  Caching has not been enabled for the task
Task ':closeSonatypeStagingRepository' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Closing staging repository with id 'comchikli-1005'
Current staging repository status: state: open, transitioning: true
Attempt 1/61 failed with result: StagingRepository(id=comchikli-1005, state=open, transitioning=true)
Current staging repository status: state: open, transitioning: false

> Task :closeSonatypeStagingRepository FAILED
:closeSonatypeStagingRepository (ThreadijExecution worker for ':',5,main|) completed. Took 10.492 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':closeSonatypeStagingRepository'.
> Staging repository is not in desired state ijclosed|: StagingRepository(id=comchikli-1005, state=open, transitioning=false). It is unexpected. Please checkNexus logs using its web interface - it can be caused by validation rules violation. If not, please report it to https://github.com/gradle-nexus/publish-plugin/issues/ with '--info' logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
8 actionable tasks: 5 executed, 3 up-to-date

build.gradle.kts is as follows:

import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    val kotlinVersion = "1.5.10"
    kotlin("jvm") version kotlinVersion
    `java-library`
    `maven-publish`
//    signing
    id("io.github.gradle-nexus.publish-plugin") version "1.1.0"

    id("com.github.ben-manes.versions") version "0.38.0"
    id("io.gitlab.arturbosch.detekt") version "1.17.1"

    kotlin("plugin.spring") version kotlinVersion
    id("org.springframework.boot") version "2.5.0" apply false
    id("io.spring.dependency-management") version "1.0.11.RELEASE"
}

repositories {
    mavenCentral()
}

dependencyManagement {
    imports {
        mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
    }
}

dependencies {
    api("io.projectreactor:reactor-core")
    api("io.projectreactor:reactor-test")

    implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
    implementation("io.projectreactor.kotlin:reactor-kotlin-extensions:1.1.3")

    testImplementation("org.springframework.boot:spring-boot-starter-test")
    testRuntimeOnly("io.r2dbc:r2dbc-h2")

    detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1")
}

val jvmVersion: JavaLanguageVersion = JavaLanguageVersion.of(11)
java {
    toolchain {
        languageVersion.set(jvmVersion)
    }
}

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = jvmVersion.toString()
    }
}

tasks.withType<Test>().configureEach {
    useJUnitPlatform()
    maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
}

tasks.withType<Detekt>().configureEach {
    this.jvmTarget = jvmVersion.toString()
}

nexusPublishing {
    repositories {
        sonatype {
            nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
            snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
        }
    }
}

publishing {
    publications {
        create<MavenPublication>("mavenJava") {
            from(components["java"])
        }
    }
}

Environment:

./gradlew --version

------------------------------------------------------------
Gradle 7.0.2
------------------------------------------------------------

Build time:   2021-05-14 12:02:31 UTC
Revision:     1ef1b260d39daacbf9357f9d8594a8a743e2152e

Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.11 (AdoptOpenJDK 11.0.11+9)
OS:           Mac OS X 11.3 x86_64

Any ideas?

@marcphilipp
Copy link
Member

@szpak Could you please take a look?

@szpak
Copy link
Contributor

szpak commented Jun 7, 2021

@nhajratw There seems to be something on the Nexus side that prevents the repository to be closed. Have you checked that staging repository in the Nexus UI? There should be mentioned a reason (from the log I suspect you didn't configure artifacts signing properly).

@nhajratw
Copy link
Contributor Author

nhajratw commented Jun 8, 2021

I was able to find the staging repository "logs" (not how i expected it to be rendered) and then had to add some additional configuration. I think it would be helpful if this info was added to the readme. I will create a PR to document the bits I needed.

@slonopotamus
Copy link
Contributor

@nhajratw So what's the cause of your issue? I'm observing the same symptoms: https://github.com/bozaro/git-lfs-java/runs/3256511416?check_suite_focus=true#step:4:92

@nhajratw
Copy link
Contributor Author

nhajratw commented Aug 5, 2021

@slonopotamus you have to look at the logs to find the cause. I created a PR #108 that describes how to do this. Looks like it hasn't been merged yet.

@slonopotamus
Copy link
Contributor

You mean, I have to configure signing?

@nhajratw
Copy link
Contributor Author

nhajratw commented Aug 6, 2021

@slonopotamus i mean you have to look at the logs to see what the problem is...

@manoellribeiro
Copy link

It is weird, but in my case the problem was happening because I was not changing the publish_version name.

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

5 participants