jongyoul / gradle-slack-plugin

Slack plugin for Gradle
Apache License 2.0
10 stars 4 forks source link

Something wrong: 404, ResponseEntityProxy{[Content-Type: text/html,Chunked: true]} #3

Closed pluttrell closed 5 years ago

pluttrell commented 5 years ago

Recently this plugin has stopped working. The build doesn't fail, but it doesn't publish to Slack and instead we see this in the console output:

01:30:06.408 [ERROR] [net.madeng.gradle.plugin.slack.SlackTask] Something wrong: 404, ResponseEntityProxy{[Content-Type: text/html,Chunked: true]}

Here's the full debug output with a few key things redacted:

01:30:06.180 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :publishToSlack' started
01:30:06.180 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Putting task artifact state for task ':publishToSlack' into context took 0.0 secs.
01:30:06.180 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':publishToSlack' is up-to-date
01:30:06.181 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Task ':publishToSlack' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
01:30:06.181 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':publishToSlack'.
01:30:06.181 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute publishToSlack for :publishToSlack' started
01:30:06.182 [DEBUG] [net.madeng.gradle.plugin.slack.SlackTask] message: {"attachments":[{"color":"good","fields":[{"title":"xxxxxxxxx","value":"`xxxxxxxxx`","short":true},{"title":"GroupId","value":"`xxxxx`","short":true},{"title":"ArtifactId","value":"`xxxxxxxx`","short":true},{"title":"Version","value":"`1.0.8`","short":true}],"actions":[],"ts":1542187806}],"channel":"#new-artifacts","text":"*Published new artifact to Maven repo.*"}
01:30:06.184 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
01:30:06.184 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
01:30:06.185 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://hooks.slack.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
01:30:06.185 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 3][route: {s}->https://hooks.slack.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
01:30:06.186 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://hooks.slack.com:443
01:30:06.186 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to hooks.slack.com/13.33.226.131:443
01:30:06.186 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to hooks.slack.com/13.33.226.131:443 with timeout 0
01:30:06.221 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1.3, TLSv1.2, TLSv1.1, TLSv1]
01:30:06.221 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
01:30:06.221 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
01:30:06.298 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
01:30:06.298 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated protocol: TLSv1.2
01:30:06.298 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
01:30:06.300 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer principal: CN=slack.com, O="Slack Technologies, Inc.", L=San Francisco, ST=CA, C=US
01:30:06.300 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  peer alternative names: [slack.com, *.slack.com]
01:30:06.302 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory]  issuer principal: CN=DigiCert SHA2 Secure Server CA, O=DigiCert Inc, C=US
01:30:06.304 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 10.1.64.23:61602<->13.33.226.131:443
01:30:06.304 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request POST /services/Txxxxxxx/Bxxxxxxxx/xxxxxxxxxxxxxxxxxx HTTP/1.1
01:30:06.304 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
01:30:06.304 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
01:30:06.408 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
01:30:06.408 [ERROR] [net.madeng.gradle.plugin.slack.SlackTask] Something wrong: 404, ResponseEntityProxy{[Content-Type: text/html,Chunked: true]}
01:30:06.408 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute publishToSlack for :publishToSlack'
jongyoul commented 5 years ago

Thanks for letting me know that. I'll dig into it.

jongyoul commented 5 years ago

I've tested it but didn't fail. Can you check it again? Otherwise, you can test it manually with

curl -X POST -H 'Content-type: application/json' --data '{"attachments":[{"color":"good","fields":[{"title":"xxxxxxxxx","value":"`xxxxxxxxx`","short":true},{"title":"GroupId","value":"`xxxxx`","short":true},{"title":"ArtifactId","value":"`xxxxxxxx`","short":true},{"title":"Version","value":"`1.0.8`","short":true}],"actions":[],"ts":1542187806}],"channel":"#new-artifacts","text":"*Published new artifact to Maven repo.*"}'  https://hooks.slack.com/services/Txxxxxxx/Bxxxxxxxx/xxxxxxxxxxxxxxxxxx

Please change the address of the incoming hook of Txxxxxxx/Bxxxxxxxx/xxxxxxxxxxxxxxxxxx to the valid one

jongyoul commented 5 years ago

This is the actual setting in build.gradle

slack {
  webhookUrl 'https://hooks.slack.com/services/TXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX'
  message {
    text = 'Herbtea is built newly and deployed into *dev*'
    iconUrl = 'http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/green-jelly-icons-food-beverage/057312-green-jelly-icon-food-beverage-coffee-tea.png'
    channel = '#zeppelinhub-deploy'
    attachment {
      authorName = "${System.properties['user.name']}"
      authorLink = 'https://github.com/jongyoul'
      //authorIcon
      color = 'Green'
      //fallback
      //footer
      //footerIcon
      //imageUrl
      //pretext
      text = 'Built Herbtea'
      //thumbUrl
      title = 'Build'
      titleLink = 'https://github.com/zepl/herbtea'
      ts = Long.parseLong("${System.currentTimeSeconds()}")
    }
  }
}
pluttrell commented 5 years ago

Thanks for the help. It turns out that somehow our endpoint got removed.

jongyoul commented 5 years ago

Thanks for clarifying it.