github / maven-plugins

Official GitHub Maven Plugins
MIT License
587 stars 197 forks source link

Error creating commit: Invalid request #69

Closed TheHolyWaffle closed 9 years ago

TheHolyWaffle commented 10 years ago
[INFO] --- site-maven-plugin:0.9:site (execution1) @ lolchatapi ---
[INFO] Creating 18 blobs
[INFO] Creating tree with 19 blob entries
[INFO] Merging with tree 9a11f1f5c5d4e3441cb3949dcf9e907fa6c1f1d0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.494 s
[INFO] Finished at: 2014-08-29T12:09:59+02:00
[INFO] Final Memory: 31M/267M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.9:site (execution1) on project lolchatapi: Error creating commit: Invalid request.
[ERROR] 
[ERROR] Expected data to be of type "object"; value was: nil.
[ERROR] Expected data to be of type "object"; value was: nil. (422)

Expected data to be of type "object"; value was: nil.
Expected data to be of type "object"; value was: nil. (422)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    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:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    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: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:46)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating commit: Invalid request.

Expected data to be of type "object"; value was: nil.
Expected data to be of type "object"; value was: nil. (422)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:440)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
Caused by: org.eclipse.egit.github.core.client.RequestException: Invalid request.

Expected data to be of type "object"; value was: nil.
Expected data to be of type "object"; value was: nil. (422)
    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.createCommit(DataService.java:397)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:434)
    ... 22 more

Everything worked great 5 days ago, but today I started getting this error. Is there anything on my end that I can do?

savageautomate commented 10 years ago

0.10-SNAPSHOT worked for me too. But only after applying @btoddb 's patch.

olavholten commented 10 years ago

It would be helpful with an error message that stated what was wrong. I had not entered an email address in my profile, causing the upload to fail. I spent several hours trying to find out what was wrong. I did learn a few things along the way though :-)

mosabua commented 10 years ago

This just broke the site deployment of the Android Maven Plugin release as well. Using 0.10-SNAPSHOT solved it for me. Can we get a new release of the site plugin asap please?

kevinsawicki commented 10 years ago

0.10 published to https://oss.sonatype.org/#nexus-search;gav~com.github.github~site-maven-plugin~0.10~~ and promoted to Maven central, apologies for the delay.

mosabua commented 10 years ago

Awesome @kevinsawicki ...

fchauvel commented 10 years ago

Surprisingly this new release 0.10 didn't works well for me at first, whereas I had been able to build my own 0.10-SNAPSHOT, which worked fine. I realized that the difference was that my code included:

      author.setEmail(userService.getEmails().get(0));

The current version checks for the email, publicly available in the user profile, where the above line takes the first email registered by the user (but which is not necessarily the public one). This may be worth considering as it does not force the user to make its email public.

olavholten commented 10 years ago

Good point! The reason I did not have an email address in my profile was exactly that. I did not want to make my email address public.

marcoslop commented 10 years ago

Version 0.10 has only worked for me when I have entered a public mail address.

krotscheck commented 10 years ago

I'm still getting this error using version 0.10, even with a public email address.

WolfgangFahl commented 10 years ago

0.10 only changes the error message - the problem persists.

[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.10:site (default) on project w3cValidator: Error creating commit: Invalid request. [ERROR] [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. (422) [ERROR] -> [Help 1] [ERROR]

problem goes away when the github profile is changed and has a public e-mail address

ppoulard commented 10 years ago

Hi, still in error with 0.11-SNAPSHOT : [ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.11-SNAPSHOT:site (site.project-website) on project alternet-libs: Error creating commit: Invalid request. [ERROR] [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. (422)

cescoffier commented 10 years ago

Did you add a public mail address on: https://github.com/settings/profile.

The Email (will be public) field must be set.

mprins commented 10 years ago

I think having a publicly published email address, especially for something as a build bot, is not the way to go... in my case site builds are always done by a bot which does not read any email.

olavholten commented 10 years ago

ppoulard, it seems you do not have a name in your profile. Both name and public email must be set I believe. Enter a name in your profile and try again. I think that will fix the problem.

WolfgangFahl commented 10 years ago

http://stackoverflow.com/questions/25560549/unable-to-deploy-maven-to-github/26012985#26012985 has an answer now pointing out the current state of affairs: you need a public e-mail address in your git profile to work with version 0.10. I think this is not good it should be possible to use the plugin without a public e-mail address. At least it should be a warning and not make the software choke on mvn site.

brianoliver commented 10 years ago

Completely agree. The maven-site-plugin shouldn't force users to enter a public (spammable) email address just to publish a web-site.

On Sep 24, 2014, at 6:28 AM, Wolfgang Fahl notifications@github.com wrote:

http://stackoverflow.com/questions/25560549/unable-to-deploy-maven-to-github/26012985#26012985 has an answer now pointing out the current state of affairs: you need a public e-mail address in your git profile to work with version 0.10. I think this is not good it should be possible to use the plugin without a public e-mail address. At least it should be a warning and not make the software choke on mvn site.

— Reply to this email directly or view it on GitHub.

bguerin commented 10 years ago

agree too, but at least now it works

the problem here is that the real fix should be in EGIT, as @btoddb mentioned but it will take so much more time ...

brianoliver commented 10 years ago

Or perhaps a simple conditional statement to check if there is an email supplied?

I added the following (as recently suggested) and it works perfectly, without requiring a public email address.

        author.setName(userService.getUser().getName()); 
        author.setEmail(userService.getEmails().get(0)); 

On Sep 25, 2014, at 12:09 PM, Benoit Guerin notifications@github.com wrote:

agree too, but at least now it works

the problem here is that the real fix should be in EGIT, as @btoddb mentioned but it will take so much more time ...

— Reply to this email directly or view it on GitHub.

burtonator commented 10 years ago

Yeah.. worked for me once I upgraded to 0.10 and then changed my public email.

I REALLY REALLY dislike having my email public like this.

Vad1mo commented 10 years ago

after updating to 0.10 it worked for me a couple of time now I detected a 500 error.

[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.10:site (default) on project website: Error creating commit: Server Error (500) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.10:site (default) on project website: Error creating commit: Server Error (500)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    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:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    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: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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating commit: Server Error (500)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:460)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.eclipse.egit.github.core.client.RequestException: Server Error (500)
    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.createCommit(DataService.java:397)
    at com.github.maven.plugins.site.SiteMojo.execute(SiteMojo.java:454)
    ... 21 more
Razican commented 9 years ago

Having the latest revision in tree, I only managed to solve it by changing author.setName(); and author.setEmail(); and hard code my name and email.

micwin commented 9 years ago

Experiencing waning patience with that. Switched over to a simple, manual process to get done with a pending release. Later will switch over to a site-publish based aproach, which has the charm of a built-in tool. Sorry for passing out.

camilolopes commented 9 years ago

hi guys, I am passing for this problem. I have updated my profile with email. But I am not getting to deploy mvn deploy. Any idea?

farolfo commented 9 years ago

Still with the same issue in 0.10. This was released with the PR submitted above?

brianoliver commented 9 years ago

I gave up on it being fixed in github. I created a branch locally and published a "fixed build" which we use for all publishing. One day when it's resolved we'll use the "fixed" version, but until then, we'll carry on without it.

farolfo commented 9 years ago

This is still failing on my en pinging to 0.11 :/, getting:

[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.11:site (default) on project MY-PROJECT: Error creating commit: Invalid request. [ERROR] [ERROR] Expected data to be of type "string"; value was: nil. [ERROR] Expected data to be of type "string"; value was: nil. (422)

What I did is to put in the settings.xml username and password that are different from the one set to git but that are allowed to push to the gh-pages branch.

angleto commented 9 years ago

I had the same problem with the version 0.11, I solved it by setting the real name on my github profile (https://github.com/github/maven-plugins/issues/85)

zkejid commented 9 years ago

Similar issue.

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.13-SNAPSHOT:site (default) on project threads: Error creating c ommit: Invalid request.

nil is not a string. nil is not a string. (422)

Not able to push artifacts: http://stackoverflow.com/questions/14013644/hosting-a-maven-repository-on-github/14013645#14013645

iToto commented 9 years ago

Getting the same issue as @zkejid anyone know which string is nil? (Using v0.10)