Error with Workbench (Could not find task)

I am trying to locally compile a binary - I have used the VS Code-based workbench for a little over a year without issue - until today that is. After compiling locally ~30 times in the past 24 hours, the compiler suddenly stopped working. I receive an error:

34%20PM

So far, I have tried uninstalling and reinstalling the particle vscode extensions (no luck) and deleting VS Code and all extension data with a fresh reinstall - also, no luck. I have run the audit with results below:

{
    "username": "dhagan@mit.edu",
    "workspace": {
        "name": "mit-wx",
        "isWorkspace": false,
        "folders": [
            {
                "location": "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx",
                "hasValidPath": true,
                "settings": {
                    "firmwareName": "deviceOS",
                    "firmwareVersion": "1.4.4",
                    "targetDevice": "",
                    "targetPlatform": "electron",
                    "compileButtonAction": "localAppDeviceOS",
                    "flashButtonAction": "localAppDeviceOS",
                    "disableWelcomeScreen": true,
                    "disableLocalCompilerDirtyCheck": false,
                    "enableVerboseLocalCompilerLogging": false,
                    "customDeviceOSLocation": ""
                },
                "files": [
                    ".DS_Store",
                    ".vscode",
                    ".vscode/launch.json",
                    ".vscode/settings.json",
                    "README.md",
                    "lib",
                    "lib/Adafruit_BME280",
                    "lib/Adafruit_Sensor",
                    "lib/Adafruit_TSL2591",
                    "lib/CellularHelper",
                    "lib/DeviceKeyHelperRK",
                    "lib/HIH61XX",
                    "lib/PublishQueueAsyncRK",
                    "lib/SdFat",
                    "lib/electronsample",
                    "project.properties",
                    "src",
                    "src/SdLog.cpp",
                    "src/SdLog.h",
                    "src/externs.h",
                    "src/globals.h",
                    "src/mit-wx.cpp",
                    "src/mit-wx.ino",
                    "src/structs.h",
                    "src/utils.h",
                    "target",
                    "target/.DS_Store",
                    "target/1.4.4"
                ]
            }
        ]
    },
    "cli": {
        "binpath": "/Users/davidhagan/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/darwin/amd64/particle",
        "ok": true,
        "version": "2.0.1",
        "installed": 1560467933361
    },
    "localCompiler": {
        "ok": true,
        "dependencies": [
            {
                "id": "deviceOS@1.4.4",
                "ok": true
            },
            {
                "id": "gcc-arm@5.3.1",
                "ok": true
            },
            {
                "id": "buildtools@1.1.1",
                "ok": true
            },
            {
                "id": "buildscripts@1.8.0",
                "ok": true
            },
            {
                "id": "openocd@0.11.2-adhoc6ea4372.0",
                "ok": true
            },
            {
                "id": "deviceOS@1.4.3",
                "ok": true
            },
            {
                "id": "deviceOS@1.4.2",
                "ok": true
            },
            {
                "id": "deviceOS@1.4.0",
                "ok": true
            },
            {
                "id": "deviceOS@1.3.0-rc.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.2.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.2.1-rc.3",
                "ok": true
            },
            {
                "id": "deviceOS@1.2.1-rc.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.1.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.1.0",
                "ok": true
            },
            {
                "id": "deviceOS@1.0.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.0.0",
                "ok": true
            },
            {
                "id": "deviceOS@0.7.0",
                "ok": true
            }
        ]
    },
    "platform": {
        "os": "darwin",
        "type": "Darwin",
        "release": "17.7.0",
        "arch": "x64",
        "path": {
            "key": "PATH",
            "value": "/usr/local/opt/ruby/bin:/Users/davidhagan/bin:/usr/local/opt/mysql@5.7/bin:/Users/davidhagan/.pyenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/davidhagan/bin:/usr/local/npm_packages/bin"
        },
        "homeDir": "/Users/davidhagan",
        "particleDir": "/Users/davidhagan/.particle",
        "localCompilerToolchainDir": "/Users/davidhagan/.particle/toolchains"
    },
    "env": {
        "ELECTRON_RUN_AS_NODE": "1",
        "__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x0",
        "TMPDIR": "/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/",
        "HOME": "/Users/davidhagan",
        "SHELL": "/bin/bash",
        "Apple_PubSub_Socket_Render": "/private/tmp/com.apple.launchd.SRKtYQtMJM/Render",
        "PATH": "/usr/local/opt/ruby/bin:/Users/davidhagan/bin:/usr/local/opt/mysql@5.7/bin:/Users/davidhagan/.pyenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/davidhagan/bin:/usr/local/npm_packages/bin",
        "LOGNAME": "davidhagan",
        "XPC_SERVICE_NAME": "com.apple.xpc.launchd.oneshot.0x10000003.Electron",
        "COMMAND_MODE": "unix2003",
        "USER": "davidhagan",
        "XPC_FLAGS": "0x0",
        "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
        "VSCODE_NODE_CACHED_DATA_DIR": "/Users/davidhagan/Library/Application Support/Code/CachedData/26076a4de974ead31f97692a0d32f90d735645c0",
        "VSCODE_LOGS": "/Users/davidhagan/Library/Application Support/Code/logs/20200107T175137",
        "VSCODE_IPC_HOOK": "/Users/davidhagan/Library/Application Support/Code/1.41.1-main.sock",
        "VSCODE_PID": "966",
        "API_ENDPOINT": "https://api.quant-aq.com/device-api/",
        "NODE_PATH": "/usr/local/npm_packages/lib/node_modules:",
        "NPM_PACKAGES": "/usr/local/npm_packages",
        "OBJC_DISABLE_INITIALIZE_FORK_SAFETY": "YES",
        "PARTICLEIO_PSWD": SECRET,
        "PARTICLEIO_TOKEN": SECRET,
        "PARTICLEIO_USERNAME": "dhagan@mit.edu",
        "PS1": "$ ",
        "PWD": "/",
        "PYENV_SHELL": "bash",
        "PYENV_VIRTUALENV_DISABLE_PROMPT": "1",
        "SHLVL": "1",
        "_": "/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/MacOS/Electron",
        "AMD_ENTRYPOINT": "vs/workbench/services/extensions/node/extensionHostProcess",
        "PIPE_LOGGING": "true",
        "VERBOSE_LOGGING": "true",
        "VSCODE_IPC_HOOK_EXTHOST": "/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/vscode-ipc-75b043c2-21ec-4b48-ba8b-6f778ba8031b.sock",
        "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
        "VSCODE_LOG_STACK": "false",
        "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true"
    },
    "versions": {
        "node": "12.4.0",
        "v8": "7.6.303.31-electron.0",
        "uv": "1.29.1",
        "zlib": "1.2.11",
        "brotli": "1.0.7",
        "ares": "1.15.0",
        "modules": "73",
        "nghttp2": "1.38.0",
        "napi": "4",
        "llhttp": "1.1.3",
        "http_parser": "2.8.0",
        "openssl": "1.1.0",
        "cldr": "35.1",
        "icu": "64.2",
        "tz": "2019a",
        "unicode": "12.1",
        "electron": "6.1.5"
    },
    "vscode": {
        "appName": "Visual Studio Code",
        "appRoot": "/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app",
        "machineId": "9c9fbc6444e27be7f45d6ed35b544a05916b159c71d7f986fed5aa901fa965a3",
        "sessionId": "9bcf4d0f-a90c-4d37-9a33-5ed82619c0781578437584773",
        "version": "1.41.1"
    },
    "extensions": [
        {
            "id": "ms-vscode.node-debug",
            "version": "1.41.1"
        },
        {
            "id": "ms-vscode.node-debug2",
            "version": "1.41.3"
        },
        {
            "id": "ms-vscode.references-view",
            "version": "0.0.42"
        },
        {
            "id": "austin.code-gnu-global",
            "version": "0.2.2"
        },
        {
            "id": "donjayamanne.githistory",
            "version": "0.4.13"
        },
        {
            "id": "eamodio.gitlens",
            "version": "10.2.0"
        },
        {
            "id": "felipecaputo.git-project-manager",
            "version": "1.7.1"
        },
        {
            "id": "marus25.cortex-debug",
            "version": "0.3.4"
        },
        {
            "id": "ms-python.python",
            "version": "2020.1.57204"
        },
        {
            "id": "ms-vscode.cpptools",
            "version": "0.26.3-insiders2"
        },
        {
            "id": "msjsdiag.debugger-for-chrome",
            "version": "4.12.3"
        },
        {
            "id": "particle.particle-vscode-core",
            "version": "1.8.1"
        },
        {
            "id": "particle.particle-vscode-pack",
            "version": "1.8.1"
        },
        {
            "id": "particle.particle-vscode-snippets",
            "version": "1.8.1"
        },
        {
            "id": "particle.particle-vscode-theme",
            "version": "1.8.1"
        }
    ]
}

Any thoughts on how to rescue myself?

:thinking: hm. i’ve only ever seen that error in two scenarios:

  1. some uncaught runtime error is thrown within the extension source
  2. trying to run a local compilation command without being in a Particle project

to investigate scenario 1, look for interesting / suspicious error messages:

  • from VSCode’s main menu, select “Help” > “Toggle Developer Tools” then click into the “Console” tab in the panel that launches
  • from VSCode’s main menu, select “View” > “Output” then use the drop-down menu at the top-right of the panel that open / focuses to review each output channel

if you spot something notable, share it here :+1:

otherwise, try the following:

  1. run the Particle: Create Project command and create a new test-only project
  2. wait for your new project to load
  3. from VSCode’s main menu, select “Terminal” > “Run Task…”
  4. in the list that appears, verify you see Particle: tasks
  5. click a Particle: task to run it

are you able to run tasks in your new project?

you can also try step 3 - listing available tasks - in your original project as this will verify whether or not tasks are being generated (and if your project is recognized as a Particle project)

lastly, it never hurts to disable unrelated extensions temporarily - Particle Workbench uses the following extensions:

marus25.cortex-debug
ms-vscode.cpptools
particle.particle-vscode-core
particle.particle-vscode-pack
particle.particle-vscode-snippets
particle.particle-vscode-theme

…trying disabling anything else you have installed (less the built-in extensions like ms-vscode.references-view) and then re-try running a task.

share you findings here and we can poke at it some more :+1:

Thanks for the suggestions! It looks like there are a host of errors on the VSCode side of things. Dev tools shows:

[Extension Host] Congratulations, your extension "code-gnu-global" is now active!
console.ts:137 [Extension Host] activating extension
console.ts:137 [Extension Host] starting language server
2console.ts:137 [Extension Host] Command: global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino" running...
console.ts:137 [Extension Host] Error: Error: Command failed: global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"/bin/sh: global: command not found `global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"` (exited with error code 127)
t.log @ console.ts:137
console.ts:137 [Extension Host] undefined
console.ts:137 [Extension Host] Error: Error: Command failed: global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"/bin/sh: global: command not found `global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"` (exited with error code 127)
t.log @ console.ts:137
console.ts:137 [Extension Host] undefined
console.ts:137 [Extension Host] Command: global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino" running...
2console.ts:137 [Extension Host] (node:5073) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:137
console.ts:137 [Extension Host] Error: Error: Command failed: global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"/bin/sh: global: command not found `global --encode-path " " -f "/Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx/src/mit-wx.ino"` (exited with error code 127)
t.log @ console.ts:137
console.ts:137 [Extension Host] undefined
console.ts:137 [Extension Host] updateCustomBrowseConfiguration
console.ts:137 [Extension Host] provideCustomConfiguration
console.ts:137 [Extension Host] custom include paths should not use recursive includes ('**')
t.log @ console.ts:137
console.ts:137 [Extension Host] updateCustomBrowseConfiguration
log.ts:196   ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.

Nothing appears in the Output/Extensions window.

For good measure I tried creating a test project and encountered the same error as before…

smells like weirdness from a 3rd party extension - try disabling all but the Workbench-related ones (see above)

Hmm…that seems to remove some errors, but not all (with the same result). Now, the console shows:

[Extension Host] activating extension
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] starting language server
2/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] (node:7634) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ /private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] updateCustomBrowseConfiguration
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] provideCustomConfiguration
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] custom include paths should not use recursive includes ('**')
t.log @ /private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:254 [Extension Host] updateCustomBrowseConfiguration
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2646 Could not find task: Compile application & DeviceOS (local) for /Users/davidhagan/Documents/github/quantaq/mit/wx/fw-mit-wx/mit-wx
onDidNotificationChange @ /private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2646
/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1572   ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.

what do you see when you select “Terminal” > “Run Task…” from VSCode’s main menu?

No task to run found: configure tasks..

grasping at straws here… best bet is to think hard about what might have changed recently in your local environment (OS upgrade, new user account, updated iCloud settings, etc)… in the meantime, a couple of other things to try:

  • create a new project outside of the Documents directory - e.g. /Users/davidhagan/test - and see if tasks work there
  • do you have other projects that you know worked in the past? do they work now?

your appRoot is weird - mine looks like:

"appRoot": "/Users/me/Applications/Visual Studio Code.app/Contents/Resources/app",

yours is:

"appRoot": "/private/var/folders/c0/lqz7knw90vn7fgq0py7z4s500000gn/T/AppTranslocation/5462532D-DF52-489C-A137-EBB5EA11DF33/d/Visual Studio Code.app/Contents/Resources/app",

…are you running it via a remote session or something? when you reinstalled VSCode, did you use our installer (https://www.particle.io/workbench#installation) or?

The appRoot definitely seemed to be the problem. I don’t know what changed that configuration, but I just wiped everything again and installed using the Particle.io installer and it works! Thanks so much!

1 Like