navicore / teams-notification-resource

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

Failure to push failed status #6

Closed siennathesane closed 2 years ago

siennathesane commented 3 years ago

Given:

    on_failure:
      do:
        - put: teams-alert
          params:
            color: FF0000
            text: |
              Failed deployment in env.
            title: Deployment Error
            actionName: Pipeline
            actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME

When the pipeline fails,

Then:

/opt/resource/out: eval: line 16: unexpected EOF while looking for matching `''
/opt/resource/out: eval: line 17: syntax error: unexpected end of file
  % 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.96.88.114...
* Connected to outlook.office.com (52.96.88.114) port 443 (#0)
* found 138 certificates in /etc/ssl/certs/ca-certificates.crt
* found 552 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: outlook.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,ST=Washington,L=Redmond,O=Microsoft Corporation,CN=outlook.com
*    start date: Thu, 02 Jul 2020 00:00:00 GMT
*    expire date: Sat, 02 Jul 2022 12:00:00 GMT
*    issuer: C=US,O=DigiCert Inc,CN=DigiCert Cloud Services CA-1
*    compression: NULL
* ALPN, server accepted to use http/1.1
> POST ***WEBHOOK URL REDACTED*** HTTP/1.1
> Host: outlook.office.com
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Length: 287
> Content-Type: application/x-www-form-urlencoded
> 
} [287 bytes data]
* upload completely sent off: 287 out of 287 bytes
< HTTP/1.1 400 Bad Request
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Length: 28
< Content-Type: text/plain; charset=utf-8
< Expires: -1
< Server: Microsoft-IIS/10.0
< request-id: bebc7780-2679-46b4-8f02-b190a4b3cc90
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< X-CalculatedBETarget: MN2PR12MB3133.namprd12.prod.outlook.com
< X-BackEndHttpStatus: 400
< X-AspNet-Version: 4.0.30319
< X-CafeServer: MN2PR01CA0050.PROD.EXCHANGELABS.COM
< X-BEServer: MN2PR12MB3133
< X-Proxy-RoutingCorrectness: 1
< X-Proxy-BackendServerStatus: 400
< X-Powered-By: ASP.NET
< X-FEServer: MN2PR01CA0050
< Date: Mon, 22 Feb 2021 17:58:56 GMT
< 
{ [28 bytes data]
100   315  100    28  100   287    105   1076 --:--:-- --:--:-- --:--:--  1078
* Connection #0 to host outlook.office.com left intact
Summary or Text is required.

It looks like it's an eval failure on the out resource. For whatever reason, successful pipeline runs don't have this problem, it's only on failures.

navicore commented 2 years ago

I've started working on this resource again. I was not able to reproduce the error. I'm happy to dig into it but need help reproducing.

I've uploaded my test pipeline here that I think is representative of your case. Let me know what I'm missing. https://github.com/navicore/teams-notification-resource/pull/20/files#diff-b829e5015c2026d0ed715423c0fa19de6c07dae3609d822a2a5922f6425cad63

Closing. Feel free to reopen!