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

Why scopt 2.12 tried to download from jitpack.io and failed with 401 Unauthorized? #4806

Closed
Mingun opened this issue Oct 26, 2021 · 3 comments

Comments

@Mingun
Copy link

Mingun commented Oct 26, 2021

  • Link to build log from https://jitpack.io
    Not sure, what you mean under "from https://jitpack.io", I don't see where I can get some logs on your site. I can provide logs of my build: see this PR

  • Does the project build on your machine with the same commands (e.g. ./gradlew install) ?
    Yes, when I clean up my local maven repository and tried to build the project, I've got the same error:

    PS D:\Projects\parsers\kaitai_struct_gui> mvn  -B package --file pom.xml
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ---------------< groupId:kaitai_struct_visualizer_java >----------------
    [INFO] Building kaitai_struct_visualizer_java 0.8-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/io/kaitai/kaitai-struct-runtime/0.9/kaitai-struct-runtime-0.9.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/io/kaitai/kaitai-struct-runtime/0.9/kaitai-struct-runtime-0.9.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/io/kaitai/kaitai-struct-runtime/0.9/kaitai-struct-runtime-0.9.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/io/kaitai/kaitai-struct-runtime/0.9/kaitai-struct-runtime-0.9.pom (4.3 kB at 9.3 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/io/kaitai/kaitai-struct-compiler_2.12/0.9/kaitai-struct-compiler_2.12-0.9.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/io/kaitai/kaitai-struct-compiler_2.12/0.9/kaitai-struct-compiler_2.12-0.9.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/io/kaitai/kaitai-struct-compiler_2.12/0.9/kaitai-struct-compiler_2.12-0.9.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/io/kaitai/kaitai-struct-compiler_2.12/0.9/kaitai-struct-compiler_2.12-0.9.pom (2.4 kB at 14 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.pom (1.6 kB at 11 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloaded from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom (923 B at 664 B/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2/12/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/github/scopt/scopt_2/12/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/scopt/scopt_2/12/scopt_sjs0.6_2.12/3.6.0/scopt_sjs0.6_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/scopt_sjs0.6_2.12/3.6.0/scopt_sjs0.6_2.12-3.6.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/github/scopt/scopt_2/12/scopt_sjs0.6_2.12/3.6.0/scopt_sjs0.6_2.12-3.6.0.pom
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.pom (2.6
    kB at 6.6 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/scala-lang/scala-library/2.12.3/scala-library-2.12.3.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/scala-lang/scala-library/2.12.3/scala-library-2.12.3.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.3/scala-library-2.12.3.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.3/scala-library-2.12.3.pom (1.6 kB at 11 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.pom (2.4 kB at 10 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.pom (1.9 kB at 13 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/scala-lang/scala-library/2.12.2/scala-library-2.12.2.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/scala-lang/scala-library/2.12.2/scala-library-2.12.2.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.2/scala-library-2.12.2.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.12.2/scala-library-2.12.2.pom (1.6 kB at 11 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/yaml/snakeyaml/1.25/snakeyaml-1.25.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/yaml/snakeyaml/1.25/snakeyaml-1.25.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/yaml/snakeyaml/1.25/snakeyaml-1.25.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/yaml/snakeyaml/1.25/snakeyaml-1.25.pom (38 kB at 181 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/Mingun/JHexView/v2.1/JHexView-v2.1.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/Mingun/JHexView/v2.1/JHexView-v2.1.pom
    [INFO] Downloaded from jitpack.io: https://jitpack.io/com/github/Mingun/JHexView/v2.1/JHexView-v2.1.pom (2.4 kB at 11 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/com/github/olivergondza/maven-jdk-tools-wrapper/0.1/maven-jdk-tools-wrapper-0.1.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/olivergondza/maven-jdk-tools-wrapper/0.1/maven-jdk-tools-wrapper-0.1.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/github/olivergondza/maven-jdk-tools-wrapper/0.1/maven-jdk-tools-wrapper-0.1.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/github/olivergondza/maven-jdk-tools-wrapper/0.1/maven-jdk-tools-wrapper-0.1.pom (5.4 kB at 18 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/mdkt/compiler/InMemoryJavaCompiler/1.3.0/InMemoryJavaCompiler-1.3.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/mdkt/compiler/InMemoryJavaCompiler/1.3.0/InMemoryJavaCompiler-1.3.0.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/mdkt/compiler/InMemoryJavaCompiler/1.3.0/InMemoryJavaCompiler-1.3.0.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/mdkt/compiler/InMemoryJavaCompiler/1.3.0/InMemoryJavaCompiler-1.3.0.pom (6.8 kB at 21 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.pom (2.7 kB at 19 kB/s)
    [INFO] Downloading from oss-sonatype: https://oss.sonatype.org/content/repositories/snapshots/org/slf4j/slf4j-parent/1.7.5/slf4j-parent-1.7.5.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/org/slf4j/slf4j-parent/1.7.5/slf4j-parent-1.7.5.pom
    [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.7.5/slf4j-parent-1.7.5.pom
    [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.7.5/slf4j-parent-1.7.5.pom (12 kB at 77 kB/s)
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  17.465 s
    [INFO] Finished at: 2021-10-26T22:59:45+05:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project kaitai_struct_visualizer_java: Could not resolve dependencies for project groupId:kaitai_struct_visualizer_java:jar:0.8-SNAPSHOT: Failed to collect dependencies at io.kaitai:kaitai-struct-compiler_2.12:jar:0.9 -> com.github.scopt:scopt_2.12:jar:3.6.0 -> com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0: Failed to read artifact descriptor for com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0: Could not transfer artifact com.github.scopt.scopt_2.12:root_2.12:pom:3.6.0 from/to jitpack.io
    (https://jitpack.io): Authentication failed for https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom 401 Unauthorized -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
    PS D:\Projects\parsers\kaitai_struct_gui> mvn  -B package --file pom.xml
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ---------------< groupId:kaitai_struct_visualizer_java >----------------
    [INFO] Building kaitai_struct_visualizer_java 0.8-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/scopt_2.12/3.6.0/scopt_2.12-3.6.0.pom
    [INFO] Downloading from jitpack.io: https://jitpack.io/com/github/scopt/scopt_2/12/scopt_sjs0.6_2.12/3.6.0/scopt_sjs0.6_2.12-3.6.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  2.785 s
    [INFO] Finished at: 2021-10-26T23:00:03+05:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project kaitai_struct_visualizer_java: Could not resolve dependencies for project groupId:kaitai_struct_visualizer_java:jar:0.8-SNAPSHOT: Failed to collect dependencies at io.kaitai:kaitai-struct-compiler_2.12:jar:0.9 -> com.github.scopt:scopt_2.12:jar:3.6.0 -> com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0: Failed to read artifact descriptor for com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0: Could not transfer artifact com.github.scopt.scopt_2.12:root_2.12:pom:3.6.0 from/to jitpack.io
    (https://jitpack.io): Authentication failed for https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom 401 Unauthorized -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
    PS D:\Projects\parsers\kaitai_struct_gui>

    But I've already have scopt dependency previously downloaded from Maven Central, I guess.
    So the question is why maven stops at your node when tries to download dependencies?
    Why your repository respond with 401 Unauthorized?

  • What error are you seeing?

    The following error in the GitHub Action (slightly formatted for readability):

    Error:
    Failed to execute goal on project kaitai_struct_visualizer_java:
      Could not resolve dependencies for project groupId:kaitai_struct_visualizer_java:jar:0.8-SNAPSHOT:
        Failed to collect dependencies at io.kaitai:kaitai-struct-compiler_2.12:jar:0.9
          -> com.github.scopt:scopt_2.12:jar:3.6.0
            -> com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0:
              Failed to read artifact descriptor for com.github.scopt.scopt_2.12:root_2.12:jar:3.6.0:
                Could not transfer artifact com.github.scopt.scopt_2.12:root_2.12:pom:3.6.0 from/to jitpack.io (https://jitpack.io):
                  authentication failed for https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom, status: 401 Unauthorized -> [Help 1]
    

    Full log: https://github.com/kaitai-io/kaitai_struct_gui/runs/4013092133?check_suite_focus=true
    I also save it in case if log by the link becomes unavailable: logs_3.zip

I've also notice strange thing -- the scopt dependency tried to download from the https://jitpack.io/com/github/scopt/scopt_2/12/root_2.12/3.6.0/root_2.12-3.6.0.pom. Notice, that the path contains .../scopt_2/12/.... It seems an error and probably it should be .../scopt_2.12/...

Mingun added a commit to Mingun/kaitai_struct_gui that referenced this issue Oct 26, 2021
@Mingun
Copy link
Author

Mingun commented Oct 26, 2021

As a workaround I've add the following into my pom.xml before the jitpack.io repository:

    <repository>
      <!--
        jitpack.io contains invalid entry for scopt dependency that requires authorization.
        Say Maven to use Maven Central first
        https://github.com/jitpack/jitpack.io/issues/4806
      -->
      <id>central</id>
      <name>Maven Central</name>
      <url>https://repo1.maven.org/maven2</url>
    </repository>

@jitpack-io
Copy link
Member

Hi

410 Unauthorized is returned when JitPack can't determine whether the project is private or public. If the repository is unreachable then it might be private and requires authentication.
Setting JitPack after Central is the recommended approach.

@Mingun
Copy link
Author

Mingun commented Oct 28, 2021

But why JitPack can't determine the private status of this project? It is definitely public. Also, why it tried to assess the library at that strange path? This dependency come from the kaitai-struct-compiler_2.12 lib and kaitai-struct-compiler_2.12-0.9.pom defines scopt dependency as:

        <dependency>
            <groupId>com.github.scopt</groupId>
            <artifactId>scopt_2.12</artifactId>
            <version>3.6.0</version>
        </dependency>

So why JitPack tried to download something other? This seems like an error during collecting dependencies by JitPack builder which turns scopt_2.12 into scopt_2/12 or something. Perhaps you should investigate this situation more carefully. In any case, thanks for your great service!

kaitai-struct-compiler_2.12-0.9.pom
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>io.kaitai</groupId>
    <artifactId>kaitai-struct-compiler_2.12</artifactId>
    <packaging>jar</packaging>
    <description>kaitai-struct-compiler</description>
    <version>0.9</version>
    <licenses>
        <license>
            <name>GPL-3.0</name>
            <url>https://opensource.org/licenses/GPL-3.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <name>kaitai-struct-compiler</name>
    <organization>
        <name>io.kaitai</name>
    </organization>
    <url>http://kaitai.io</url>
    <scm>
        <connection>scm:git:git://github.com/kaitai-io/kaitai_struct_compiler.git</connection>
        <developerConnection>scm:git:ssh://github.com:kaitai-io/kaitai_struct_compiler.git</developerConnection>
        <url>http://github.com/kaitai-io/kaitai_struct_compiler/tree/master</url>
    </scm>
    <developers>
        <developer>
            <name>Mikhail Yakshin</name>
            <email>[email protected]</email>
            <organization>Kaitai Project</organization>
            <organizationUrl>http://kaitai.io</organizationUrl>
        </developer>
    </developers>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.12.4</version>
        </dependency>
        <dependency>
            <groupId>com.github.scopt</groupId>
            <artifactId>scopt_2.12</artifactId>
            <version>3.6.0</version>
        </dependency>
        <dependency>
            <groupId>com.lihaoyi</groupId>
            <artifactId>fastparse_2.12</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.25</version>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.12</artifactId>
            <version>3.0.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

Mingun added a commit to Mingun/kaitai_struct_gui that referenced this issue Oct 28, 2021
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