{"record":{"id":"609a6dabe16ec3ca","repo":"xpipe-io/xpipe","slug":"connection-datastorage-get-getstorepath-e-t","errorCode":null,"errorMessage":"Connection \" + DataStorage.get().getStorePath(e).toString() + \" is not a shell connection","messagePattern":"Connection \" \\+ DataStorage\\.get\\(\\)\\.getStorePath\\(e\\)\\.toString\\(\\) \\+ \" is not a shell connection","errorType":"exception","errorClass":"BeaconClientException","httpStatus":400,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/beacon/api/TerminalExternalLaunchExchange.java","lineNumber":44,"sourceCode":"        return \"/terminal/externalLaunch\";\n    }\n\n    @Override\n    public Object handle(HttpExchange exchange, Request msg) throws BeaconClientException, BeaconServerException {\n        var found = DataStorageQuery.queryUserInput(msg.getConnection());\n        if (found.isEmpty()) {\n            throw new BeaconClientException(\"No connection found for input \" + msg.getConnection());\n        }\n\n        if (found.size() > 1) {\n            throw new BeaconClientException(\"Multiple stores found: \"\n                    + found.stream().map(DataStoreEntry::getName).toList());\n        }\n\n        var e = found.getFirst();\n        var isShell = e.getStore() instanceof ShellStore;\n        if (!isShell) {\n            throw new BeaconClientException(\n                    \"Connection \" + DataStorage.get().getStorePath(e).toString() + \" is not a shell connection\");\n        }\n\n        if (!checkPermission()) {\n            return Response.builder().command(List.of()).build();\n        }\n\n        var r = TerminalLauncherManager.externalExchange(e.ref(), msg.getArguments());\n        return Response.builder().command(r).build();\n    }\n\n    @Override\n    public boolean requiresEnabledApi() {\n        return false;\n    }\n\n    @Override\n    public Object getSynchronizationObject() {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/beacon/api/TerminalExternalLaunchExchange.java#L26-L62","documentation":"After a unique connection is resolved, the exchange checks that its DataStore implements ShellStore. Non-shell connections cannot be opened in an external terminal as a shell, so the handler throws with the full store path for clarity.","triggerScenarios":"Calling terminal/external launch with a connection whose store is not a ShellStore — e.g. a script, vault, data-store (database), or custom store entry.","commonSituations":"Scripts pick the first search result without checking its type; user passes a database or script connection where a shell was expected; a connection that previously hosted a shell sub-connection was targeted directly instead of its shell child.","solutions":["Target the shell sub-connection of the store (e.g. the SSH child) rather than the parent","Check e.getStore() instanceof ShellStore before launching","Use the shell/start API for shell session management instead of external launch","Create a shell-capable connection for the host you need"],"exampleFix":"// before\nclient.terminalLaunch(\"my-database\"); // not a shell\n// after\nif (entry.getStore() instanceof ShellStore) {\n    client.terminalLaunch(entry.getUuid());\n} else {\n    client.terminalLaunch(\"my-database/ssh\"); // shell child\n}","handlingStrategy":"type-guard","validationCode":"DataStoreEntry e = found.getFirst();\nif (!(e.getStore() instanceof ShellStore)) throw new IllegalArgumentException(\"not a shell: \" + e.getName());","typeGuard":"static boolean isShell(DataStoreEntry e) {\n    return e.getStore() instanceof ShellStore;\n}","tryCatchPattern":"try {\n    client.terminalLaunch(input);\n} catch (BeaconClientException ex) {\n    if (ex.getMessage().contains(\"is not a shell connection\")) {\n        // target a shell sub-connection instead\n    } else throw ex;\n}","preventionTips":["Check instanceof ShellStore before terminal launch","Target shell sub-connections of composite stores","Filter search results to shell stores"],"tags":["terminal","shell","xpipe"],"backgroundTag":"unsupported-operation","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}