github/maven-plugins

Error creating commit: Invalid request

TheHolyWaffle opened this issue · 79 comments

[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?

Same here

After some debug, I think it is because commit.getAuthor() and commit.getCommitter() are null

I believe so the same. Maybe it needs a setAuthor and setCommitter here : SiteMojo.java#L422-L424

Hi

I have the same issue, did u fix it? Where do I place the setAuthor and/or commiter?

Haven't fixed it as I'm not familiar with Mojo's at all. I hope someone else can take a look at this.

@TheHolyWaffle not fixed neither. I think the mojo can indeed ask for a commiter, but for compatibility purpose, I think the fix should rather be in the egit library (ie check if commiter / author is null before adding to JSON send to github API)

See also #70

Something has changed on Github server side, since everything worked fine three days ago. Maybe we should email them and ask for help?

@yegor256 contacted us via support and I sent him an email in which I explained what I believe is the issue here.

I'm guessing that the process is creating Git trees via the Git Trees API:

https://developer.github.com/v3/git/trees/#create-a-tree

Notice that this API takes a base_tree as input, which should be a SHA of a tree object. However, up until recently the API was more forgiving about this field. Specifically, if you passed in a SHA of a commit (and not a SHA of a tree), the API detected this and fetched the SHA of the tree which the commit pointed to and used that as input. In other words, the API handled undocumented input in an expected way.

Recently, this behavior changed in the way that the API no longer supports this undocumented behavior. The error which the API is returning in this case is currently not very helpful (a 409 indicating that there's a problem with the repository), and that's a bug which will be fixed soon. Still, the process which is interacting with the API should be passing in the correct value as the base_tree -- it should be a SHA of a tree object, not a SHA of a commit object, as documented.

I'm really sorry that this is causing problems for you. Since this change didn't affect documented behavior, we didn't blog about it in advance.

@cescoffier @kevinsawicki -- my Java is weak, so heads up on this in case you can fix this or want to accept a pull request from someone in the community.

Hello @izuzak

Thanks for posting here.
The issue we have does not seem to be what your describe. My debug run lead me to a 422 error code, not a 409

Thanks @bguerin! Can you post the full request-response pair which is causing problems (an equivalent of a curl -v call)? That would be helpful in investigating this since the output above doesn't contain that information. Thanks!

(My hunch: I'm guessing that the 422 happens when the process tries to create a commit based on the response from a previously failed call to create a Git tree.)

Hey pplz,

I had the same error and fixed it by adding author and committer to the commit object. I am using the egit java client and via debugging found that it will send null values in the params to the github api if they are not set. Per the docs author and committer have the same keys. https://developer.github.com/v3/git/commits/

To note, when not initialized the author objects is sent with blank strings for email and name and null for date. The committer is simply sent as null.

hope this helps.

A snippet of my fix:
ex:
Commit commit = new Commit();
commit.setMessage(CommitTitle);
commit.setTree(tree);
CommitUser user = createCommitUser();
commit.setAuthor(user);
commit.setCommitter(user);
List listOfCommits = new ArrayList();
listOfCommits.add(new Commit().setSha(baseCommitSha));
commiteTest.setParents(listOfCommits);

public CommitUser createCommitUser(String email, String name) {
    CommitUser  cUser = new CommitUser();
    cUser.setEmail(email);
    cUser.setName(name);
    Format formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
    Calendar now = Calendar.getInstance();
    cUser.setDate(now.getTime());
    return cUser;
}

Also, thanks @izuzak for the debug help and quick response. I had the 409 issue as well as the 422 error.
The 409 was per me using the incorrect sha value.

The 422 nil error was the author and committer issue (as described above).

To note, this is what the params looked like, when not instantiating the author and committer on the commit object.
{
"message": "Update",
"author": {
"name": "",
"email": "",
"date": null
},
"parents": [
"5bdec286c41258e16f1df7051c3df399e7080831"
],
"tree": "69f6ea6c5c023e3d2af9cb3eb0dfa10e31765f55"
"committer": null
}

Ahhh, thanks @dgreenfield0 ❤️! Seems like this indeed isn't caused by the Git Trees API change after all, as @bguerin mentioned. A few other users were affected by those stricter validations today, so I jumped the 🔫 on this one. (Also, I only read the initial issue, not the other comments in which it was already figured out what the problem was -- really sorry about that and for the false alarm.)

So, shall we submit a pull request to this maven plugin? What is the plan now? :)

Hi,

Just submit a PR, will have a look to it.

Clement

On 31 août 2014 at 09:14:59, Yegor Bugayenko (notifications@github.com) wrote:

So, shall we submit a pull request to this maven plugin? What is the plan now? :)


Reply to this email directly or view it on GitHub.

This pull request fixes the problem: #71

BTW, if you need help of deploying to Maven Central, this method may be helpful: http://www.yegor256.com/2014/08/19/how-to-release-to-maven-central.html

indeed, guys, would be awesome to fix this ASAP. many people are suffering...

Upgrading to 0.10-SNAPSHOT this morning made some progress but doesn't completely resolve the issue. The new error message is:

Expected data to be of type "string"; value was: nil. (422)

Hopefully the full stack trace is helpful?

Expected data to be of type "string"; 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:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating commit: Invalid request.

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

Expected data to be of type "string"; value was: nil.
Expected data to be of type "string"; 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:454)
    ... 21 more

Happy to help out testing snapshots as they are updated / made available.

Cheers

-- Brian

@brianoliver do the commands git config --get-all user.email and git config --get-all user.name give you the user credentials you use for this repository?
if not you should set them using git config

Short answer: Yes. Both commands return the correct user.email and user.name (I use git config).

Anything else I can try?

PS: My user name contains a space.

Anything else I can try?

sorry don't know atm. Assuming you build an up-2-date snapshot. does running with -X git any hints?

@brianoliver i solved this issue by setting dryRun=true

but i have another problem it doesn't do the upload (SHA-1 is null)
[INFO] Creating commit with SHA-1: null
[INFO] Updating reference refs/heads/gh-pages from ed59cc4d597a51284ccf2726c867c2c90da91bc5 to null

is my configuration wrong? Its my first time using the plugin, great timing!

Updated to the latest snapshot. Tried using dryRun, which in fact isn't a solution as I don't want a "dry run". Same issue:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.10-SNAPSHOT:site (default) on project oracle-tools-site: Error creating commit: Invalid request.

Expected data to be of type "string"; value was: nil.
Expected data to be of type "string"; 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:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating commit: Invalid request.

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

Expected data to be of type "string"; value was: nil.
Expected data to be of type "string"; 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:454)
    ... 21 more
[ERROR] 
[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/MojoExecutionException

Though it is very basic question , but can some please help me how can i try the Snapshot version , I am facing the same problem
Expected data to be of type "object"; value was: nil. (422)

@kapilag snapshot version won't help. The bug is still in master.

can someone please merge one of the provided pull requests and fix the broken plugin? who is a maintainer of it?

Merge is done, see 87c5b2e

Now, a release would be just fine ;)

NO I tested the latest From source and still " "string"; value was: nil." is there

@yegor #72 was pulled into master; though there is 1 report of this not fixing the problem

@kapilag check out the sourcecode and run mvn install
your local repo will provide the snapshot

@mprins I do have snapshot build but it is not helping on issue as now it throw error as @brianoliver posted "Expected data to be of type "string"; value was: nil. (422)"

tip checkouted, builed and running just fine here

@theanuradha : maybe your local GIT conf is missing / incorrect ?

@bguerin Maven Build was config with Github AUTH key so it dose not matter my local GIT conf

the following patch worked for me ... my email was being retrieved as null,
even though it was set both globally and in the local project.

Index:
github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8


github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java
(revision
4c80551)
+++
github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java
(revision
)
@@ -432,8 +432,8 @@
User user = userService.getUser();

         CommitUser author = new CommitUser();
  •        author.setName(user.getName());
    
  •        author.setEmail(user.getEmail());
    
  •        author.setName(userService.getUser().getName());
    
  •        author.setEmail(userService.getEmails().get(0));
         author.setDate(new GregorianCalendar().getTime());
    
         commit.setAuthor(author);
    

On Mon, Sep 8, 2014 at 7:37 PM, Anuradha G notifications@github.com wrote:

@bguerin https://github.com/bguerin Maven Build was config with Github
AUTH key so it dose not matter my local GIT conf


Reply to this email directly or view it on GitHub
#69 (comment).

that patch is for 0.10-SNAPSHOT

On Mon, Sep 8, 2014 at 10:17 PM, B. Todd Burruss btoddb@gmail.com wrote:

the following patch worked for me ... my email was being retrieved as
null, even though it was set both globally and in the local project.

Index:
github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8


github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java (revision
4c80551)
+++
github-site-plugin/src/main/java/com/github/maven/plugins/site/SiteMojo.java (revision
)
@@ -432,8 +432,8 @@
User user = userService.getUser();

         CommitUser author = new CommitUser();
  •        author.setName(user.getName());
    
  •        author.setEmail(user.getEmail());
    
  •        author.setName(userService.getUser().getName());
    
  •        author.setEmail(userService.getEmails().get(0));
         author.setDate(new GregorianCalendar().getTime());
    
         commit.setAuthor(author);
    

On Mon, Sep 8, 2014 at 7:37 PM, Anuradha G notifications@github.com
wrote:

@bguerin https://github.com/bguerin Maven Build was config with Github
AUTH key so it dose not matter my local GIT conf


Reply to this email directly or view it on GitHub
#69 (comment)
.

it is working for me as well 0.10-SNAPSHOT

@btoddb is right, my email was null also before his patch

@theanuradha : you are mixing things ...
My Maven project is also using an OAUTH key, but this only deals with authentication with GitHub servers (ie when doing a push).
Before doing that push, the plugin will do a commit and this involves your local git configuration to retrieve who you are (name and mail) to set the autor of this commit.
Exactly the same thing with git commands by IDE / hand : commit reads your local config (name/email), push will use your credentials (name/password or SSH key or OAUTH key) to authenticate yourself on GitHub servers.

@bguerin well before it did not need local git config it use OAUTH key associate account information.

Thanks to the patch from @btoddb, it now works! Brilliant work tracking this down.

can we get a fixed version released to Maven Central please?

i should say that i believe the real fix for this should probably be in
EGit, but that would probably take longer. my guess, what a client really
wants would be the email/name from the local repository, and if that's not
set then get it from the global settings.

On Tue, Sep 9, 2014 at 7:42 AM, Yegor Bugayenko notifications@github.com
wrote:

can we get a fixed version released to Maven Central please?


Reply to this email directly or view it on GitHub
#69 (comment).

I think btoddb is absolutely correct, his patch didn't work for me, but I checked out the plugin and set hard coded the Username and Email values!!

        CommitUser author = new CommitUser();
        author.setName("gtsntzs");
        author.setEmail("myEmail");

I know it is ugly.... but works

I Confirm that 0.10-SNAPSHOT works. At least for me.

The Repo owner should make a release ASAP as it fixes the problem for some users already. Im not saying that the reported problems of others is less important but for those were 0.10-SNAPSHOT works can work again.
For those with problems we can keep digging for the solution and bring it in 0.11

There is no need to wait here. bring it out!!!

Can someone tell me where I can get the SNAPSHOT from Maven is not finding it?

you must download and build it

On Sat, Sep 13, 2014 at 11:30 AM, StrateboLouis notifications@github.com
wrote:

Can someone tell me where I can get the SNAPSHOT from Maven is not finding
it?


Reply to this email directly or view it on GitHub
#69 (comment).

Thanks I was afraid of that

@StrateboLouis it's really not that hard... definitely not something to be afraid of

git clone https://github.com/github/maven-plugins.git maven-plugins
cd maven plugins
mvn install

I know,

Just a bit bummed that it took me 2 hours to run into the conversation explaining why my development setup was broken.

Thanks for the support.

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

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 :-)

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?

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.

Awesome @kevinsawicki ...

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.

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.

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

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

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

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)

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

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

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.

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.

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.

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.

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 ...

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.

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.

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

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.

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.

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?

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

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.

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.

I had the same problem with the version 0.11, I solved it by setting the real name on my github profile (#85)

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

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