1. Sebastian Sebastian
  2. scm-manager
  3. Issues


Issue #334 resolved

webhook $(commit.*} not working

Felix Gustavsson
created an issue

None of the $(commit.*) variables are working. I have the query set to http://mydomain.com/commitbot.php?type=2&repository_name=${repository.name}&repository_id=${repository.id}&commit_id=${commit.id}&commit_author=${commit.author.name}&commit_description=${commit.description}&commit_modifications=${commit.modifications} but all commit variables are just empty strings.

Would be great if this could get fixed soon.

Edit: & should be &, but bitbucket replaces them in the url for some reason.

Comments (24)

  1. Felix Gustavsson reporter

    Now it does not contact the web server at all, I've tried both commit and changeset. It would also be great if you could make a test call to see if everything is working, so I don't have to make a commit each time I need to test it.

  2. Felix Gustavsson reporter

    The only log files I can find is in scm-server/var/log but they just contain this:

    [2013-02-20 17:17:16] [info]  Run service finished.
    [2013-02-20 17:17:16] [info]  Commons Daemon procrun finished
    [2013-02-20 17:17:16] [info]  Commons Daemon procrun ( 64-bit) started
    [2013-02-20 17:17:16] [info]  Running 'scm-server' Service...
    [2013-02-20 17:17:16] [info]  Starting service...
    [2013-02-20 17:17:17] [info]  Service started in 1497 ms.
    [2013-02-20 17:18:02] [info]  Stopping service...
    [2013-02-20 17:18:04] [info]  Service stopped.
    [2013-02-20 17:18:04] [info]  Run service finished.
    [2013-02-20 17:18:04] [info]  Commons Daemon procrun finished
    [2013-02-20 17:18:04] [info]  Commons Daemon procrun ( 64-bit) started
    [2013-02-20 17:18:04] [info]  Running 'scm-server' Service...
    [2013-02-20 17:18:04] [info]  Starting service...
    [2013-02-20 17:18:06] [info]  Service started in 1504 ms.

    Even when TRACE is on, I'm running it as a service btw.

  3. Sebastian Sebastian repo owner

    You should see a folder called .scm in the home of the user which started the scm-manager process (c:\documents..\username\.scm). If you are started scm-manager as daemon the folder is probably at c:.scm. Could you find this folder?

  4. Felix Gustavsson reporter

    Found the folder and the error

    18:55:02.165 [Hook-0] TRACE sonia.scm.net.URLHttpClient - header map is emtpy
    18:55:02.177 [Hook-0] ERROR sonia.scm.webhook.WebHookExecutor - error during webhook execution for http://domain.com/commitbot.php?type=2&repository_name=test&repository_id=5VNxu3ASH1&commit_id=e49881994ad1190e53bf3025a3b4a30b66cf6871&commit_author=Felix Gustavsson&commit_description=Commit message&commit_modifications=added:
    java.net.MalformedURLException: Illegal character in URL
        at sun.net.www.http.HttpClient.getURLFile(Unknown Source) ~[na:1.7.0_07]
        at sun.net.www.protocol.http.HttpURLConnection.getRequestURI(Unknown Source) ~[na:1.7.0_07]
        at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source) ~[na:1.7.0_07]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[na:1.7.0_07]
        at java.net.HttpURLConnection.getResponseCode(Unknown Source) ~[na:1.7.0_07]
        at sonia.scm.net.URLHttpResponse.getStatusCode(URLHttpResponse.java:222) ~[classes/:na]
        at sonia.scm.webhook.WebHookExecutor.execute(WebHookExecutor.java:212) [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.webhook.WebHookExecutor.run(WebHookExecutor.java:108) [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.webhook.RepositoryWebHook.executeWebHooks(RepositoryWebHook.java:136) [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.webhook.RepositoryWebHook.onEvent(RepositoryWebHook.java:101) [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.repository.RepositoryHookTask.run(RepositoryHookTask.java:84) [scm-core-1.28.jar:na]
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.1-scm1.jar:1.2.1-scm1]
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.1-scm1.jar:1.2.1-scm1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_07]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_07]
        at java.lang.Thread.run(Unknown Source) [na:1.7.0_07]

    It looks like the data is not URL encoded.

  5. Sebastian Sebastian repo owner

    That's true. You could use ${commit.modifications.added}, ${commit.modifications.modified} and ${commit.modifications.removed}. But i think this will result in the next encoding problem. I will try to fix this as well. But i'm not sure how to format the output. For modifications something like this:


    And for modifications.[added,modified,removed] something like this:


    What do you think?

  6. Log in to comment