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${}&repository_id=${}&commit_id=${}&commit_author=${}&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 Sdorra 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 - header map is emtpy
    18:55:02.177 [Hook-0] ERROR sonia.scm.webhook.WebHookExecutor - error during webhook execution for Gustavsson&commit_description=Commit message&commit_modifications=added:
    removed: Illegal character in URL
        at Source) ~[na:1.7.0_07]
        at Source) ~[na:1.7.0_07]
        at Source) ~[na:1.7.0_07]
        at Source) ~[na:1.7.0_07]
        at Source) ~[na:1.7.0_07]
        at ~[classes/:na]
        at sonia.scm.webhook.WebHookExecutor.execute( [scm-webhook-plugin-1.1.jar:na]
        at [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.webhook.RepositoryWebHook.executeWebHooks( [scm-webhook-plugin-1.1.jar:na]
        at sonia.scm.webhook.RepositoryWebHook.onEvent( [scm-webhook-plugin-1.1.jar:na]
        at [scm-core-1.28.jar:na]
        at [shiro-core-1.2.1-scm1.jar:1.2.1-scm1]
        at [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$ Source) [na:1.7.0_07]
        at Source) [na:1.7.0_07]

    It looks like the data is not URL encoded.

  5. Sebastian Sdorra 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