From 279ab6023359dccd73c4b74d3297c5c70800bbef Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Wed, 26 Jul 2017 10:41:25 -0300 Subject: [PATCH 1/2] Fix the message shown when docker gives a 500 error when starting a container The test for an exec format error caused a `err.json.trim` is not a function error so the message shown didn't relate to what the problem actually was. This makes the test for the exec format error safer. Change-Type: patch Signed-off-by: Pablo Carranza Velez --- src/application.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/application.coffee b/src/application.coffee index 6fced1cf..74aeba08 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -244,6 +244,12 @@ shouldMountKmod = (image) -> console.error('Error getting app OS release: ', err) return false +isExecFormatError = (err) -> + message = '' + try + message = err.json.trim() + /exec format error$/.test(message) + application.start = start = (app) -> device.isResinOSv1().then (isV1) -> volumes = utils.defaultVolumes(isV1) @@ -319,7 +325,7 @@ application.start = start = (app) -> alreadyStarted = true return - if statusCode is '500' and err.json.trim().match(/exec format error$/) + if statusCode is '500' and isExecFormatError(err) # Provide a friendlier error message for "exec format error" device.getDeviceType() .then (deviceType) -> From 097262878d3e81e5ca8e1419d1d30be4486bfe7f Mon Sep 17 00:00:00 2001 From: "resin-io-versionbot[bot]" Date: Wed, 26 Jul 2017 18:47:54 +0000 Subject: [PATCH 2/2] v6.0.4 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7547da12..9ba7f282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +## v6.0.4 - 2017-07-26 + +* Fix the message shown when docker gives a 500 error when starting a container [Pablo Carranza Velez] + ## v6.0.3 - 2017-07-25 * Use a pinned build of the debian image to build base and gosuper, to avoid unnecessary rebuilds [Pablo Carranza Velez] diff --git a/package.json b/package.json index 19b9d559..eeb57172 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "resin-supervisor", "description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.", - "version": "6.0.3", + "version": "6.0.4", "license": "Apache-2.0", "repository": { "type": "git",