navicore / teams-notification-resource

for Concourse CI notifications on Microsoft Teams
MIT License
32 stars 33 forks source link

HTTP Error 400: Bad payload received by generic incoming webhook. #39

Closed username-is-already-taken2 closed 1 year ago

username-is-already-taken2 commented 1 year ago

Hi there

Firstly, thanks for this resource, I've used it for a while now.

Today I noticed that that this resource has been silently failing, the resource triggers but doesn't work as it's getting a 400 error back and a response from microsoft saying Bad payload received by generic incoming webhook. Not sure if they've dropped support for the format used by this resource?

Here is the verbose output using your hello-world test job in the repo.

BUILD_PIPELINE_NAME trigger-test

selected worker: ************

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 52.97.179.194:443...

* Connected to *****************.webhook.office.com (52.97.179.194) port 443 (#0)

* ALPN, offering h2

* ALPN, offering http/1.1

* successfully set certificate verify locations:

*  CAfile: /etc/ssl/certs/ca-certificates.crt

*  CApath: /etc/ssl/certs

} [5 bytes data]

* TLSv1.3 (OUT), TLS handshake, Client hello (1):

} [512 bytes data]

* TLSv1.3 (IN), TLS handshake, Server hello (2):

{ [88 bytes data]

* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):

} [1 bytes data]

* TLSv1.3 (OUT), TLS handshake, Client hello (1):

} [512 bytes data]

* TLSv1.3 (IN), TLS handshake, Server hello (2):

{ [187 bytes data]

* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):

{ [19 bytes data]

* TLSv1.3 (IN), TLS handshake, Certificate (11):

{ [3004 bytes data]

* TLSv1.3 (IN), TLS handshake, CERT verify (15):

{ [264 bytes data]

* TLSv1.3 (IN), TLS handshake, Finished (20):

{ [52 bytes data]

* TLSv1.3 (OUT), TLS handshake, Finished (20):

} [52 bytes data]

* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384

* ALPN, server accepted to use h2

* Server certificate:

*  subject: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; CN=*.webhook.office.com

*  start date: May 28 00:00:00 2023 GMT

*  expire date: May 28 23:59:59 2024 GMT

*  subjectAltName: host "*****************.webhook.office.com" matched cert's "*.webhook.office.com"

*  issuer: C=US; O=DigiCert Inc; CN=DigiCert Cloud Services CA-1

*  SSL certificate verify ok.

* Using HTTP2, server supports multi-use

* Connection state changed (HTTP/2 confirmed)

* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0

} [5 bytes data]

* Using Stream ID: 1 (easy handle 0x557389e90580)

} [5 bytes data]

> POST ***WEBHOOK URL REDACTED*** HTTP/2

> Host: *****************.webhook.office.com

> user-agent: curl/7.74.0

> accept: */*

> content-length: 352

> content-type: application/x-www-form-urlencoded

> 

} [5 bytes data]

* We are completely uploaded and fine

{ [5 bytes data]

* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

{ [437 bytes data]

* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!

} [5 bytes data]

100   352    0     0  100   352      0    278  0:00:01  0:00:01 --:--:--   278< HTTP/2 400 

< content-length: 49

< content-type: text/plain; charset=utf-8

< server: Microsoft-IIS/10.0

< request-id: da8aaade-7937-dc47-10ce-49c8e1233f71

< strict-transport-security: max-age=31536000; includeSubDomains; preload

< alt-svc: h3=":443",h3-29=":443"

< x-preferredroutingkeydiagnostics: 1

< x-calculatedfetarget: LO2P265CU009.internal.outlook.com

< x-backendhttpstatus: 400

< x-calculatedbetarget: LO0P123MB4844.GBRP123.PROD.OUTLOOK.COM

< x-backendhttpstatus: 400

< x-end2endlatencyms: 1446

< x-rum-validated: 1

< x-rum-notupdatequeriedpath: 1

< x-rum-notupdatequerieddbcopy: 1

< x-proxy-routingcorrectness: 1

< x-proxy-backendserverstatus: 400

< x-bepartition: CLGBRP123LHR03

< x-feproxyinfo: AM0P190CA0008.EURP190.PROD.OUTLOOK.COM

< x-feefzinfo: AMS

< ms-cv: 3qqK2jd5R9wQzknI4SM/cQ.1.1

< x-feserver: LO2P265CA0205

< x-firsthopcafeefz: AMS

< x-powered-by: ASP.NET

< x-feserver: AM0P190CA0008

< date: Mon, 24 Jul 2023 14:35:15 GMT

< 

{ [49 bytes data]

100   401  100    49  100   352     31    223  0:00:01  0:00:01 --:--:--   254

* Connection #0 to host *****************.webhook.office.com left intact

Bad payload received by generic incoming webhook.
navicore commented 1 year ago

thanks for the report. please take a look at https://github.com/navicore/teams-notification-resource/issues/36 - it seems to be the same issue and you just need to use the latest image created a couple weeks ago.

username-is-already-taken2 commented 1 year ago

Thank you for the suggestion, I thought i was using the latest tag but I'll try setting it to the version specific one v0.9.9

username-is-already-taken2 commented 1 year ago

Set the tag to the version v0.9.9 and it worked, not sure why it won't use that when setting latest.

Thanks for your help

navicore commented 1 year ago

ah. the latest tag might be broken then. I'll take a look at the CI script. thx!

navicore commented 1 year ago

I've confirmed the "latest" tag is still being created - I suspect your docker daemon was just using a previously downloaded image.