Closed pedropombeiro closed 10 years ago
On teamcity-winservice.log:
[2014-02-11 10:16:14,772] stdout [Info] Auth header: QWRtaW46TGllYmhlcnItMQ==
[2014-02-11 10:16:14,972] stdout [Info] Could not send data to Stash.
[2014-02-11 10:16:14,972] stdout [Info] Server returned HTTP response code: 500 for URL: http://stash/rest/build-status/1.0/commits/70c97cc05e84b2e0b800d1b40c2f47779f97f58f
[2014-02-11 10:16:14,972] stdout [Info] [Ljava.lang.StackTraceElement;@36da3c
[2014-02-11 10:16:14,972] stdout [Info] Updated Stash status for revision: 70c97cc05e84b2e0b800d1b40c2f47779f97f58f, buildId: 68346, status: SUCCESSFUL
[2014-02-11 10:17:50,096] stdout [Info] Scheduling Stash status update for hash: 70c97cc05e84b2e0b800d1b40c2f47779f97f58f, buildId: 68345, status: SUCCESSFUL
[2014-02-11 10:17:50,096] stdout [Info] Sending build status to http://stash/rest/build-status/1.0/commits/70c97cc05e84b2e0b800d1b40c2f47779f97f58f
[2014-02-11 10:17:50,096] stdout [Info] With body: {
[2014-02-11 10:17:50,096] stdout [Info] "state": "SUCCESSFUL",
[2014-02-11 10:17:50,096] stdout [Info] "key": "68345",
[2014-02-11 10:17:50,096] stdout [Info] "name": "Build #1.0.22.11066, Tests passed: 5395, ignored: 1",
[2014-02-11 10:17:50,096] stdout [Info] "url": "http://teamcity/viewLog.html?buildId=68345&buildTypeId=Lidia_Features_UnitTest",
[2014-02-11 10:17:50,096] stdout [Info] "description": "[Lioba Family :: LIDIA :: Features :: Unit Test] février 11, 2014 10:17"
[2014-02-11 10:17:50,096] stdout [Info] }
[2014-02-11 10:17:50,096] stdout [Info] Auth header: QWRtaW46TGllYmhlcnItMQ==
[2014-02-11 10:17:50,196] stdout [Info] Could not send data to Stash.
[2014-02-11 10:17:50,196] stdout [Info] Server returned HTTP response code: 500 for URL: http://stash/rest/build-status/1.0/commits/70c97cc05e84b2e0b800d1b40c2f47779f97f58f
[2014-02-11 10:17:50,196] stdout [Info] [Ljava.lang.StackTraceElement;@1cebfd
[2014-02-11 10:17:50,196] stdout [Info] Updated Stash status for revision: 70c97cc05e84b2e0b800d1b40c2f47779f97f58f, buildId: 68345, status: SUCCESSFUL
[2014-02-11 10:17:51,605] stdout [Info] Scheduling Stash status update for hash: 70c97cc05e84b2e0b800d1b40c2f47779f97f58f, buildId: 68348, status: IN_PROGRESS
[2014-02-11 10:17:51,605] stdout [Info] Sending build status to http://stash/rest/build-status/1.0/commits/70c97cc05e84b2e0b800d1b40c2f47779f97f58f
[2014-02-11 10:17:51,605] stdout [Info] With body: {
[2014-02-11 10:17:51,605] stdout [Info] "state": "INPROGRESS",
[2014-02-11 10:17:51,605] stdout [Info] "key": "68348",
[2014-02-11 10:17:51,605] stdout [Info] "name": "Build #1.0.22.11066, Running",
[2014-02-11 10:17:51,605] stdout [Info] "url": "http://teamcity/viewLog.html?buildId=68348&buildTypeId=Lidia_Features_CreateClickOnceApplicationManifest",
[2014-02-11 10:17:51,605] stdout [Info] "description": "[Lioba Family :: LIDIA :: Features :: Create ClickOnce Application Manifest] février 11, 2014 10:17"
[2014-02-11 10:17:51,605] stdout [Info] }
Is your build configuration called février
? I'm not setting an encoding anywhere, so your investigation is probably correct. I'll need to set an encoding somewhere.
The code will be erroring here:
The build configuration is called Lidia_Features_CreateClickOnceApplicationManifest.
Ah, the février
must be February.
Exactly :-)
The problem was here. I tried with wr.writeUtf
, and wr.writeBytes
, didn't work. I changed it to use wr.write
and used String.getBytes("UTF-8")
instead.
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.write(body.getBytes("UTF-8"));
wr.flush();
wr.close();
Seems to be working now.
I've updated the zip. Please test, let me know if it doesn't work.
Awesome, you're the man! Thanks for being so reactive!
I'll try it out tomorrow morning.
I can confirm it works now. Thanks again!
I recently upgraded to TeamCity 8.0.6 and I'm not sure if it is because of that, but the TeamCity/Stash integration stopped working. I looked at the atlassian-stash.log file and I have plenty of JSON parsing exceptions. It looks like the JSON is not UTF-8 encoded, as Stash is expecting.
I took a look around the web and found a hint: http://stackoverflow.com/a/18176032
Can you confirm that the plugin is using the default charset, and not explicitly enforcing UTF-8?
Thanks for your help, Pedro