Jenkins change notifications not sent

Issue #681 open
Chris Peacock
created an issue

Jenkins change notifications do not appear to be getting sent when we check in files to a Git repository. I've checked the access log for our Jenkins server and no requests for new builds are being made, so it's not a URL path or Jenkins problem. The server is on the same box as SCM Manager so it's unlikely to be a network problem. I've tried the Jenkins configuration for the SCM repository both with and without the 'Username' and 'API Token' parameters. (The Jenkins server responds correctly to the HTTP GET request http://<server name>:<port>/jenkins/job/<project name>/build?token=hythtyj57uj35672n568 , i.e. no user name or API token parameters.)

Comments (16)

  1. Chris Peacock reporter

    Update - I think the plugin may be sending POSTs to Jenkins, which is probably expecting GETs. There are two POSTs in the access log at the time of checkin, both with error 505 (which means "HTTP Version Not Supported").

  2. Chris Peacock reporter

    The problem is that the 'Project' field for the Jenkins properties is not being URL encoded. The Jenkins project name contains spaces and these are being passed through as-is resulting in the 505 error as Jenkins thinks that the first part of the project name after the space is the request protocol.

    The workaround is to URL encode the project name before entering it in the Project text box, in my case this meant replacing all spaces with %20.

  3. Chris Peacock reporter

    This may or may not still be a problem with the plugin - the project name is being encoded with spaces turned into '+' which Jenkins does not like. For example, the Jenkins access log:

    [18/Feb/2015:17:14:00 +0000] "POST /jenkins/job/My+project+name/build HTTP/1.1" 404 949

    Accessing the URL in a web browser also returns a 404 but the same URL with '%20' in place of '+' works.

    I've tried to set Jenkins' Tomcat URI Encoding to UTF-8 but it makes no difference. I don't know how to set SCM Manager's (Jetty?) URI encoding but I've read that Jetty defaults to UTF-8 anyway.

  4. Chris Peacock reporter

    Hi Sebastian, I think there's still a problem. The access log for Jenkins shows:

    172.16.100.42 - - [23/Feb/2015:15:49:12 +0000] "POST /jenkins/job/My%20project/build HTTP/1.1" 500 14227

    Jenkins' log shows:

    Feb 23, 2015 3:49:12 PM org.apache.catalina.core.ApplicationContext log SEVERE: Error while serving http://servername:8090/jenkins/job/My%20project/build java.lang.reflect.InvocationTargetException .... Caused by: javax.servlet.ServletException: This page expects a form submission but had only {token=[Ljava.lang.String;@a565a50}

    The same project worked with the old version with this URL when I manually added in the '%20' to the project name.

  5. Sebastian Sebastian repo owner

    In my test it worked without problems. But it seems to be more a problem with the request body instead of the url. Could you test it without jenkins authentication (perhaps on a test instance)?

  6. Chris Peacock reporter

    I removed the 'token' setting in SCM Manager, the 'Authentication token' from the Jenkins job, and granted job / build permission to 'anonymous' in Jenkins. The following error now appears (top of error same as before):

    ...Caused by: javax.servlet.ServletException: This page expects a form submission but had only {}

  7. Log in to comment