{"action":"created","issue":{"url":"https://api.github.com/repos/adobe/helix-cli/issues/648","repository_url":"https://api.github.com/repos/adobe/helix-cli","labels_url":"https://api.github.com/repos/adobe/helix-cli/issues/648/labels{/name}","comments_url":"https://api.github.com/repos/adobe/helix-cli/issues/648/comments","events_url":"https://api.github.com/repos/adobe/helix-cli/issues/648/events","html_url":"https://github.com/adobe/helix-cli/issues/648","id":421393769,"node_id":"MDU6SXNzdWU0MjEzOTM3Njk=","number":648,"title":"The curious case of HTTP 200/OK {}","user":{"login":"trieloff","id":39613,"node_id":"MDQ6VXNlcjM5NjEz","avatar_url":"https://avatars3.githubusercontent.com/u/39613?v=4","gravatar_id":"","url":"https://api.github.com/users/trieloff","html_url":"https://github.com/trieloff","followers_url":"https://api.github.com/users/trieloff/followers","following_url":"https://api.github.com/users/trieloff/following{/other_user}","gists_url":"https://api.github.com/users/trieloff/gists{/gist_id}","starred_url":"https://api.github.com/users/trieloff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trieloff/subscriptions","organizations_url":"https://api.github.com/users/trieloff/orgs","repos_url":"https://api.github.com/users/trieloff/repos","events_url":"https://api.github.com/users/trieloff/events{/privacy}","received_events_url":"https://api.github.com/users/trieloff/received_events","type":"User","site_admin":false},"labels":[{"id":984858332,"node_id":"MDU6TGFiZWw5ODQ4NTgzMzI=","url":"https://api.github.com/repos/adobe/helix-cli/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":984858339,"node_id":"MDU6TGFiZWw5ODQ4NTgzMzk=","url":"https://api.github.com/repos/adobe/helix-cli/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"open","locked":false,"assignee":{"login":"stefan-guggisberg","id":1543625,"node_id":"MDQ6VXNlcjE1NDM2MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1543625?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-guggisberg","html_url":"https://github.com/stefan-guggisberg","followers_url":"https://api.github.com/users/stefan-guggisberg/followers","following_url":"https://api.github.com/users/stefan-guggisberg/following{/other_user}","gists_url":"https://api.github.com/users/stefan-guggisberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-guggisberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-guggisberg/subscriptions","organizations_url":"https://api.github.com/users/stefan-guggisberg/orgs","repos_url":"https://api.github.com/users/stefan-guggisberg/repos","events_url":"https://api.github.com/users/stefan-guggisberg/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-guggisberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"stefan-guggisberg","id":1543625,"node_id":"MDQ6VXNlcjE1NDM2MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1543625?v=4","gravatar_id":"","url":"https://api.github.com/users/stefan-guggisberg","html_url":"https://github.com/stefan-guggisberg","followers_url":"https://api.github.com/users/stefan-guggisberg/followers","following_url":"https://api.github.com/users/stefan-guggisberg/following{/other_user}","gists_url":"https://api.github.com/users/stefan-guggisberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stefan-guggisberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefan-guggisberg/subscriptions","organizations_url":"https://api.github.com/users/stefan-guggisberg/orgs","repos_url":"https://api.github.com/users/stefan-guggisberg/repos","events_url":"https://api.github.com/users/stefan-guggisberg/events{/privacy}","received_events_url":"https://api.github.com/users/stefan-guggisberg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2019-03-15T07:52:00Z","updated_at":"2019-03-20T17:41:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"While working on #645 (i.e. adobe/helix-pipeline#209 and adobe/developer.adobe.com-planning#183) I've been looking into the \"HTTP 200/OK {}\" issue most of us have seen:\r\n\r\n- it occurs only in Runtime\r\n- HTTP status is 200, even when things are decidedly **not OK**\r\n- `wsk activation logs` is empty\r\n- even when requesting with `X-Debug: silly`, the logs are super sparse like this:\r\n```\r\n2019-03-14T22:29:49.377Z       stdout: debug: Constructing HTML Pipeline\r\n2019-03-14T22:29:49.377Z       stdout: debug: Creating pipeline\r\n2019-03-14T22:29:49.379Z       stdout: debug: initializing ajv {\"useDefaults\":true,\"coerceTypes\":true}\r\n2019-03-14T22:29:49.383Z       stdout: debug: error {\"error\":{},\"request\":\"92d5b4d8-97ee-465d-a650-aa37f8b34f09\",\"activation\":\"5d5c5f195c0a457f9c5f195c0aa57f47\",\"function\":\"html\"}\r\n```\r\n- the response is an empty JSON object `{}` (the `Content-Type` is JSON, too)\r\n\r\nThe error happens when there is a sufficiently hard exception in the *construction* of the pipeline, i.e. when a `require` can't be satisfied as in #645 or when a critical environment variable can't be read as in https://github.com/adobe/helix-pipeline/issues/142. As this happens before the pipeline can be run, the normal error handling of the pipeline never takes.\r\n\r\nI've done a bit of (ultimately ineffective) digging around in the `OutputWrapper` to add a `try/catch` block that would return a proper error 500 (and log what it can get), but this wasn't effective. \r\n\r\nI'd be glad for another pair of eyes on the problem."},"comment":{"url":"https://api.github.com/repos/adobe/helix-cli/issues/comments/474951391","html_url":"https://github.com/adobe/helix-cli/issues/648#issuecomment-474951391","issue_url":"https://api.github.com/repos/adobe/helix-cli/issues/648","id":474951391,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NDk1MTM5MQ==","user":{"login":"filmaj","id":52645,"node_id":"MDQ6VXNlcjUyNjQ1","avatar_url":"https://avatars0.githubusercontent.com/u/52645?v=4","gravatar_id":"","url":"https://api.github.com/users/filmaj","html_url":"https://github.com/filmaj","followers_url":"https://api.github.com/users/filmaj/followers","following_url":"https://api.github.com/users/filmaj/following{/other_user}","gists_url":"https://api.github.com/users/filmaj/gists{/gist_id}","starred_url":"https://api.github.com/users/filmaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filmaj/subscriptions","organizations_url":"https://api.github.com/users/filmaj/orgs","repos_url":"https://api.github.com/users/filmaj/repos","events_url":"https://api.github.com/users/filmaj/events{/privacy}","received_events_url":"https://api.github.com/users/filmaj/received_events","type":"User","site_admin":false},"created_at":"2019-03-20T17:41:18Z","updated_at":"2019-03-20T17:41:18Z","author_association":"MEMBER","body":"This came up again in https://github.com/adobe/developer.adobe.com-planning/issues/188\r\n\r\nI ended up manually wrapping some `try/catch` blocks around HTML pipeline creation to get more logs. Looks like the wrong `ajv` was packaged (5.5.2 was packaged, need 6.0.0+ to support latest json schema, 6.6.2 is defined in helix-pipeline's package.json). More details in https://github.com/adobe/developer.adobe.com-planning/issues/188"}}
{"actor":{"display_login":"filmaj"}}