github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

Error creating blob: Not Found (404) #63

Open dkirrane opened 10 years ago

dkirrane commented 10 years ago

I'm hitting the following exception while running mvn site I tried with both my username password and an OAuth token

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.9:site (default) on project: Error creating blob: Not Found (404)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating blob: Not Found (404)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:289)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:352)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.eclipse.egit.github.core.client.RequestException: Not Found (404)
    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:552)
    at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:643)
    at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:757)
    at org.eclipse.egit.github.core.service.DataService.createBlob(DataService.java:115)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:285)
    ... 22 more
micwin commented 10 years ago

Looks like something is wrong with the url. Does it end with a / or something like that? Are there accidentially some spaces in between? Look for cloaked errors like 0s that should be Os and such.Does username/passwd ro oauth toke contain escape characters or such? If that's not, validate your pom and your settings.xml.

kolotyluk commented 10 years ago

I am getting the same error. What URL are you talking about?

joschi commented 10 years ago

The plugin tries to infer the correct owner and repository of the GitHub project from project.url, scm.url, scm.connection, and scm.developerConnection (in that order).

You can override these with the repositoryOwner and repositoryName configuration settings for the plugin.

See http://github.github.com/maven-plugins/site-plugin/project.html for details.

kolotyluk commented 10 years ago

As far as I can tell, my URLs look OK. The release plugin is happy with my scm configuration, so I assume those URLs are good.

What else could be the problem?

What does this error actually mean?

joschi commented 10 years ago

Please set repositoryOwner and repositoryName explicitly and try again. Usually that error can be traced back to the plugin not finding the correct repository.

kolotyluk commented 10 years ago

OK, that's the ticket.

Thanks :-)

Now the question is, bases on my scm, why was the plugin not able to sort things out...

https://github.com/kolotyluk/java-file-utilities.git scm:git:https://github.com/kolotyluk/java-file-utilities.git scm:git:https://github.com/kolotyluk/java-file-utilities.git HEAD

Cheers, Eric

On 3/26/2014 3:45 PM, Jochen Schalanda wrote:

Please set |repositoryOwner| and |repositoryName| explicitly and try again. Usually that error can be traced back to the plugin not finding the correct repository.

— Reply to this email directly or view it on GitHub https://github.com/github/maven-plugins/issues/63#issuecomment-38749981.

joschi commented 10 years ago

What's the value of project.url in your POM?

kolotyluk commented 10 years ago
http://kolotyluk.github.io/java-file-utilities

On 3/26/2014 4:20 PM, Jochen Schalanda wrote:

What's the value of |project.url| in your POM?

— Reply to this email directly or view it on GitHub https://github.com/github/maven-plugins/issues/63#issuecomment-38752863.

kolotyluk commented 10 years ago

Thanks, that actually fixes the problem too.

The .git suffix has caused other problems (misunderstandings) for me in the past.

I guess what comes to mind are two possible remedies:

  1. Better diagnostics in the plug-in itself to look for such (mis)use cases
  2. Better documentation with more examples and troubleshooting tips.

I also notice there is no wiki for this project. If there was, perhaps more people like myself could document our remedies for the issues we have dealt with.

In spite of the trouble I have had, this plug-in is such a great idea at further automating Maven site generation with GitHub. I hope the GitHub team continue to improve Maven integration this way.

On 3/27/2014 7:09 AM, Jochen Schalanda wrote:

It's not very clear from the documentation but from looking at https://github.com/github/maven-plugins/blob/38930f370e115ea930564d96f71b2c233a39cd89/github-core/src/main/java/com/github/maven/plugins/core/RepositoryUtils.java you should use https://github.com/kolotyluk/java-file-utilities as your scm.url https://maven.apache.org/pom.html#SCM – without the |.git| suffix.

— Reply to this email directly or view it on GitHub https://github.com/github/maven-plugins/issues/63#issuecomment-38806485.

maxandersen commented 9 years ago

I have same error, tried setting all of the above settings - still same error. any tips on how to trace what url is it actually choking on ?

marcphilipp commented 9 years ago

We've looked through the code. The URL in question seems to be https://api.github.com/user/emails. In our case, we've used an OAuth token that lacked the 'user:email' scope.

wethchaoj2kuvifpe11ucxngakyactabjsaeligbjyyalyelrhityajmgakwasbabfqcaavalnjm3egmwasyabngakyaczqisadk3saemaatyajmgakwgryjwakwxr44n5cjmaemwasyabngaiwauq8wasbabjgae2actkdfclaablehzs1lakyactabjsaemaalqo4dtiajmaemwasyabnomqisafvsgxnzmqatyajmgakwasbaapd7ab

After adding that scope, it worked for us.

HTH

anjbur commented 9 years ago

I'm getting a very similar error message. In addition to the above errors, mine is also throwing this:

Error creating blob: You have triggered an abuse detection mechanism and have been temporarily blocked from calling the API. Please retry your request again later. (403) -> [Help 1]

I've tried it with username password, and an OAuth token with the scope as above. I've also checked on the rate limit, and it's counting one run of mvn site as one request. I'm nowhere near that limit.

Debug is showing that it successfully creates 91 out of 550 blobs before it crashes.

bguerin commented 9 years ago

See #88 and #17

bguerin commented 9 years ago

Thanks @marcphilipp, works for me now !

marcphilipp commented 9 years ago

@anjbur Can you show us a stacktrace?

yodaqua commented 8 years ago

Hi

I'm getting the same error.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>com.kineticskunk.auto</groupId>
<artifactId>functional</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>functional</name>
<url>https://github.com/KineticSkunk/functional-test-automation</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- github server corresponds to entry in ~/.m2/settings.xml -->
    <github.global.server>github</github.global.server>
</properties>

<scm>
    <url>https://github.com/KineticSkunk/functional-test-automation.git</url>
    <connection>scm:git:git@github.com:KineticSkunk/functional-test-automation.git</connection>
    <developerConnection>scm:git:git@github.com:KineticSkunk/functional-test-automation.git</developerConnection>
</scm>

<distributionManagement>
    <repository>
        <id>internal.repo</id>
        <name>Temporary Staging Repository</name>
        <url>file://${project.build.directory}/mvn-repo</url>
    </repository>
</distributionManagement>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
                <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>0.9</version>
            <configuration>
                <!--<repositories>
                    <id>git-yodaqua</id>
                    <name>functional-test-automation</name>
                    <url>https://github.com/KineticSkunk/functional-test-automation/tree/mvn-repo</url>
                </repositories> -->
                <message>Maven artifacts for ${project.version}</message>  <!-- git commit message -->
                <noJekyll>true</noJekyll>                                  <!-- disable webpage processing -->
                <outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
                <branch>refs/heads/mvn-repo</branch>                       <!-- remote branch name -->
                <includes>
                    <include>**/*</include>
                </includes>
                <merge>true</merge>
                <!--  <url>https://github.com/KineticSkunk/functional-test-automation</url> -->
                <repositoryName>functional-test-automation</repositoryName>      <!-- github repo name -->
                <repositoryOwner>yodaqua</repositoryOwner>    <!-- github username -->
                <server>github</server>
            </configuration>
            <executions>
                <!-- run site-maven-plugin's 'site' target as part of the build's normal 
                    'deploy' phase -->
                <execution>
                    <goals>
                        <goal>site</goal>
                    </goals>
                    <phase>deploy</phase>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <!-- logging -->
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.4</version>
        <scope>test</scope>
    </dependency>
    <!-- testing -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

yodaqua commented 8 years ago

Error message:

[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.9:site (default) on project functional: Error creating blob: Not Found (404) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.9:site (default) on project functional: Error creating blob: Not Found (404)

yodaqua commented 8 years ago

Please help

joschi commented 8 years ago

@yodaqua The latest version of the plugin solved this problem for me. Try upgrading to version 0.12 (you're using 0.9 in your POM).

yodaqua commented 8 years ago

Hi, thanks. Didn't work for me :(

Do you have a sample pom which I could compare my POM?

Thanks

yodaqua commented 8 years ago

I've made changes to my POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>com.kineticskunk.auto</groupId>
<artifactId>functional</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>functional</name>
<url>https://github.com/KineticSkunk/functional-test-automation</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- github server corresponds to entry in ~/.m2/settings.xml -->
    <github.global.server>github</github.global.server>
</properties>

<scm>
    <url>https://github.com/KineticSkunk/functional-test-automation.git</url>
    <connection>scm:git:git@github.com:KineticSkunk/functional-test-automation.git</connection>
    <developerConnection>scm:git:git@github.com:KineticSkunk/functional-test-automation.git</developerConnection>
</scm>

<distributionManagement>
    <repository>
        <id>internal.repo</id>
        <name>Temporary Staging Repository</name>
        <url>file://${project.build.directory}/mvn-repo</url>
    </repository>
</distributionManagement>

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <testResources>
        <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
        </testResource>
    </testResources>
    <plugins>
        <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> 
            <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> 
            </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-source-plugin</artifactId> <version>2.3</version> <executions> 
            <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> 
            </executions> </plugin> -->
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
                <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19</version>
            <configuration>
                <argLine>-Xmx1024m</argLine>
                <excludes>
                    <exclude>**/AppTest.java</exclude>
                    <exclude>**/WebDriverTestSuite.java</exclude>
                </excludes>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.19</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>0.12</version>
            <configuration>
                <!--<repositories> <id>git-yodaqua</id> <name>functional-test-automation</name> 
                    <url>https://github.com/KineticSkunk/functional-test-automation/tree/mvn-repo</url> 
                    </repositories> -->
                <message>Maven artifacts for ${project.version}</message>  <!-- git commit message -->
                <noJekyll>true</noJekyll>                                  <!-- disable webpage processing -->
                <outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
                <branch>refs/heads/mvn-repo</branch>                       <!-- remote branch name -->
                <includes>
                    <include>**/*</include>
                </includes>
                <merge>true</merge>
                <!-- <url>https://github.com/KineticSkunk/functional-test-automation</url> -->
                <repositoryName>maven-plugins</repositoryName>      <!-- github repo name -->
                <repositoryOwner>github</repositoryOwner>    <!-- github username -->
                <server>github</server>
            </configuration>
            <executions>
                <!-- run site-maven-plugin's 'site' target as part of the build's normal 
                    'deploy' phase -->
                <execution>
                    <goals>
                        <goal>site</goal>
                    </goals>
                    <phase>deploy</phase>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <!-- Build an executable JAR -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <finalName>kineticskunk</finalName>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <!-- testing -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.47.1</version>
    </dependency>
    <dependency>
        <groupId>ru.stqa.selenium</groupId>
        <artifactId>webdriver-factory</artifactId>
        <version>1.1.47</version>
    </dependency>
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>2.2.0</version>
    </dependency>
    <!-- logging -->
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.4</version>
    </dependency>
</dependencies>

joschi commented 8 years ago

@yodaqua See https://github.com/joschi/nosqlunit-elasticsearch2/blob/nosqlunit-elasticsearch2-0.8.1-1/pom.xml for a working example.

yodaqua commented 8 years ago

Thanks! It's working :)

Changes I made are: 1) Added a snapshotRepository to distributionManagement 2) Changed the repositoryOwner to the name of my organization (it was my github login name)

jkremser commented 8 years ago

@marcphilipp awesome, adding the email scope to the oauth token helped for me.

The plugin should definitely have better error messages when running with mvn -X

marco-brandizi commented 7 years ago

Maybe this can be useful: I've just had the same problem (405, not allowed) while trying to deploy on a GH repository. I couldn't do it because of repo size limits (https://help.github.com/articles/what-is-my-disk-quota/). Temp solution was to remove the .zip produced by the Assembly plugin for a command-line tool from the deployment. I don't like it, cause I'd like to use the Maven repo to distribute the project's binaries, but for the moment at least I nailed down the source of the problem.

Tusenka commented 7 years ago

I have the same error after changing 0.9 version to 0.12 version:

Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default-cli) on project java2js-structure-maven-plugin: Error creating blob: Not Found (404) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default-cli) on project java2js-structure-maven-plugin: Error creating blob: Not Found (404)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating blob: Not Found (404)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:294)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:356)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 26 more
Caused by: org.eclipse.egit.github.core.client.RequestException: Not Found (404)
    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:552)
    at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:643)
    at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:757)
    at org.eclipse.egit.github.core.service.DataService.createBlob(DataService.java:115)
    at com.github.maven.plugins.site.SiteMojo.createBlob(SiteMojo.java:289)
    ... 29 more
danielflower commented 2 years ago

For me (using version 0.12) this was caused by authentication iues.

I fixed by changing from my github username and password in my maven settings to a personal access token

I granted the following to the token:

In my ~/.m2/settings.xml in the github server config, I just put my created token as the password with no username:

    <server>
          <id>github</id>
          <password>(my private token)</password>
    </server>