From e80116cccac9dbcf5e3c40f47fedd614f1e24eaa Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 4 Sep 2018 11:19:22 -0400 Subject: [PATCH] Simplified friendly task error messages logic, added new friendly message for corrupted installations --- app/static/app/js/components/TaskListItem.jsx | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/app/static/app/js/components/TaskListItem.jsx b/app/static/app/js/components/TaskListItem.jsx index 26eaa491..beef295d 100644 --- a/app/static/app/js/components/TaskListItem.jsx +++ b/app/static/app/js/components/TaskListItem.jsx @@ -31,8 +31,7 @@ class TaskListItem extends React.Component { actionButtonsDisabled: false, editing: false, memoryError: false, - badDatasetError: false, - illegalInstructionError: false, + friendlyTaskError: "", pluginActionButtons: [] } @@ -100,7 +99,7 @@ class TaskListItem extends React.Component { } if (this.state.task.status !== statusCodes.FAILED){ - this.setState({memoryError: false, badDatasetError: false, illegalInstructionError: false}); + this.setState({memoryError: false, friendlyTaskError: ""}); } } }else{ @@ -231,10 +230,18 @@ class TaskListItem extends React.Component { line.indexOf("Failed to allocate memory") !== -1){ this.setState({memoryError: true}); }else if (line.indexOf("SVD did not converge") !== -1){ - this.setState({badDatasetError: true}); + this.setState({friendlyTaskError: `It looks like the images might have one of the following problems: + + You can read more about best practices for capturing good images here.`}); }else if (line.indexOf("Illegal instruction") !== -1 || line.indexOf("Child returned 132") !== -1){ - this.setState({illegalInstructionError: true}); + this.setState({friendlyTaskError: "It looks like this computer might be too old. WebODM requires a computer with a 64-bit CPU supporting MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support or higher. You can still run WebODM if you compile your own docker images. See this page for more information."}); + }else if (line.indexOf("Child returned 127") !== -1){ + this.setState({friendlyTaskError: "The processing node is missing a program necessary to complete the task. This might indicate a corrupted installation. If you built OpenDroneMap, please check that all programs built without errors."}); } } } @@ -364,12 +371,10 @@ class TaskListItem extends React.Component { if (this.state.expanded){ let showOrthophotoMissingWarning = false, showMemoryErrorWarning = this.state.memoryError && task.status == statusCodes.FAILED, - showBadDatasetWarning = this.state.badDatasetError && task.status == statusCodes.FAILED, - showIllegalInstructionWarning = this.state.illegalInstructionError && task.status == statusCodes.FAILED, + showTaskWarning = this.state.friendlyTaskError !== "" && task.status == statusCodes.FAILED, showExitedWithCodeOneHints = task.last_error === "Process exited with code 1" && !showMemoryErrorWarning && - !showBadDatasetWarning && - !showIllegalInstructionWarning && + !showTaskWarning && task.status == statusCodes.FAILED, memoryErrorLink = this.isMacOS() ? "http://stackoverflow.com/a/39720010" : "https://docs.docker.com/docker-for-windows/#advanced"; @@ -495,19 +500,8 @@ class TaskListItem extends React.Component { {showMemoryErrorWarning ?
It looks like your processing node ran out of memory. If you are using docker, make sure that your docker environment has enough RAM allocated. Alternatively, make sure you have enough physical RAM, reduce the number of images, make your images smaller, or tweak the task's options.
: ""} - {showBadDatasetWarning ? -
It looks like the images might have one of the following problems: -
    -
  • Not enough images
  • -
  • Not enough overlap between images
  • -
  • Images might be too blurry (common with phone cameras)
  • -
- You can read more about best practices for capturing good images here. -
: ""} - - {showIllegalInstructionWarning ? -
It looks like this computer might be too old. WebODM requires a computer with a 64-bit CPU supporting MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support or higher. You can still run WebODM if you compile your own docker images. See this page for more information. -
: ""} + {showTaskWarning ? +
: ""} {showExitedWithCodeOneHints ?