Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Pull Request activity throws IllegalArgumentException #194

Closed
Rychard opened this issue Feb 1, 2017 · 1 comment
Closed

Pull Request activity throws IllegalArgumentException #194

Rychard opened this issue Feb 1, 2017 · 1 comment
Labels

Comments

@Rychard
Copy link

Rychard commented Feb 1, 2017

It seems that Bitbucket is logging an exception when nearly anything is done to a pull request. The endpoint it mentions on the first line differs, but it's the same exception in the stack trace.

It doesn't seem to be related to any of my notifications, as the exception is thrown even for events that I haven't selected to be a trigger for any notification.

That said, this error doesn't seem to cause a real issue; all the notifications work as I expect them to, but our notifications are basic requests to the HipChat API, differing only by some static text, they all have identical configuration beyond that.

I removed any sensitive data from the configuration and log entry below, but if I've forgotten something don't hesitate to ask.

[
  {
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn"
      }
    ],
    "method": "POST",
    "name": "Pull Request Approved",
    "postContent": "{\"from\": \"Bitbucket Pull Request\",\"color\": \"yellow\",\"notify\": \"true\",\"message_format\": \"html\",\"message\": \"${PULL_REQUEST_USER_DISPLAY_NAME} approved a pull request from ${PULL_REQUEST_AUTHOR_DISPLAY_NAME}.\",\"card\": {\"id\": \"${PULL_REQUEST_FROM_HASH}\",\"style\": \"link\",\"description\": {\"value\": \"${PULL_REQUEST_USER_DISPLAY_NAME} approved a pull request from ${PULL_REQUEST_AUTHOR_DISPLAY_NAME}.\",\"format\": \"html\"},\"format\": \"compact\",\"url\": \"${PULL_REQUEST_URL}\",\"title\": \"[${PULL_REQUEST_FROM_REPO_NAME}] ${PULL_REQUEST_TITLE} (#${PULL_REQUEST_ID})\"}}",
    "triggerIfCanMerge": "ALWAYS",
    "triggerIgnoreStateList": [],
    "triggers": [
      "APPROVED"
    ],
    "url": "https://api.hipchat.com/v2/room/1234567/notification",
    "uuid": "222d5cc3-d81a-4668-9008-b774f7da8d68",
    "postContentEncoding": "HTML"
  }
]
2017-02-01 08:44:30,826 ERROR [threadpool:thread-4] shejos0 @1AB2CDE345F678901x0 1A2BCDE 123.123.123.123 "POST /rest/api/latest/projects/MyProject/repos/MyRepository/pull-requests/123/comments HTTP/1.1" se.bjurr.prnfb.http.UrlInvoker 
java.lang.IllegalArgumentException: Entity may not be null
	at org.apache.http.util.Args.notNull(Args.java:54) ~[httpcore-4.4.4.jar:4.4.4]
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:214) ~[httpcore-4.4.4.jar:4.4.4]
	at se.bjurr.prnfb.http.UrlInvoker.doInvoke(UrlInvoker.java:358) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.http.UrlInvoker.invoke(UrlInvoker.java:164) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener$1.invoke(PrnfbPullRequestEventListener.java:94) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener.notify(PrnfbPullRequestEventListener.java:264) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener.handleEvent(PrnfbPullRequestEventListener.java:116) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener.access$000(PrnfbPullRequestEventListener.java:60) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener$2.run(PrnfbPullRequestEventListener.java:132) [plugin.8408883496469262364.pull-request-notifier-for-bitbucket-2.50_1485882361846.jar:na]
	at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:70) [bitbucket-platform-4.13.0.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_74]
	at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_74]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_74]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_74]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_74]
	at java.lang.Thread.run(Unknown Source) [na:1.8.0_74]
	... 1 frame trimmed
@tomasbjerre
Copy link
Owner

This is now in 2.51. Open issue again if any problems!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants