{"record":{"id":"d361d6598d6bc512","repo":"quarkusio/quarkus","slug":"can-only-sync-state-on-the-server-side-of-remote-d","errorCode":null,"errorMessage":"Can only sync state on the server side of remote dev mode","messagePattern":"Can only sync state on the server side of remote dev mode","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java","lineNumber":732,"sourceCode":"    @Override\n    public void addPreRestartStep(Runnable runnable) {\n        preRestartSteps.add(runnable);\n    }\n\n    @Override\n    public void addPostRestartStep(Runnable runnable) {\n        postRestartSteps.add(runnable);\n    }\n\n    @Override\n    public void consumeNoRestartChanges(Consumer<Set<String>> consumer) {\n        noRestartChangesConsumers.add(consumer);\n    }\n\n    @Override\n    public Set<String> syncState(Map<String, String> fileHashes) {\n        if (getDevModeType() != DevModeType.REMOTE_SERVER_SIDE) {\n            throw new RuntimeException(\"Can only sync state on the server side of remote dev mode\");\n        }\n        Set<String> ret = new HashSet<>();\n        try {\n            Map<String, String> ourHashes = new HashMap<>(IsolatedRemoteDevModeMain.createHashes(applicationRoot));\n            for (Map.Entry<String, String> i : fileHashes.entrySet()) {\n                String ours = ourHashes.remove(i.getKey());\n                if (!Objects.equals(ours, i.getValue())) {\n                    ret.add(i.getKey());\n                }\n            }\n            List<Path> removedFiles = List.of();\n            for (Map.Entry<String, String> remaining : ourHashes.entrySet()) {\n                String file = remaining.getKey();\n                if (file.endsWith(\"META-INF/MANIFEST.MF\") || file.contains(\"META-INF/maven\")\n                        || !file.contains(\"/\")) {\n                    //we have some filters, for files that we don't want to delete\n                    continue;\n                }","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java#L714-L750","documentation":"RuntimeUpdatesProcessor.syncState merges client-side file hashes into the server's state and is only meaningful on the server side of remote dev mode. If the current dev mode is not DevModeType.LOCAL or REMOTE_SERVER_SIDE — specifically anything other than REMOTE_SERVER_SIDE per the guard — it throws a RuntimeException. Calling it on a remote client or offline instance is a programming/lifecycle error.","triggerScenarios":"Calling syncState(fileHashes) when getDevModeType() != DevModeType.REMOTE_SERVER_SIDE — e.g. invoked against a remote-dev client (REMOTE_CLIENT_SIDE) or a plain local dev mode instance not acting as the remote server.","commonSituations":"Pointing a sync client at the wrong Quarkus instance (client instead of server); starting the server without -Dquarkus.launch.rebuild-all-in-remote-dev... i.e. without remote-server-side dev mode enabled; custom tooling calling syncState outside remote-dev.","solutions":["Start the target in remote server-side dev mode (quarkus:dev with remote-dev server configuration, DevModeEntry requiring REMOTE_SERVER_SIDE).","Point your sync client at the server-side URL, not a remote-dev client instance.","Verify quarkus.remote-dev configuration: client mode instances should push via the client, not call syncState directly.","Remove any custom code calling syncState in non-remote-dev runs."],"exampleFix":"// before: client-side instance\n// ./mvnw quarkus:remote-dev (client) then POST to its own syncState -> throws\n// after: run server side first\n// server: ./mvnw quarkus:dev -Dquarkus.launch.devmode=true (server-side remote)\n// client: ./mvnw quarkus:remote-dev -Dquarkus.remote-dev.url=http://server:8080","handlingStrategy":"validation","validationCode":"if (processor.getDevModeType() != DevModeType.REMOTE_SERVER_SIDE) {\n    throw new IllegalStateException(\"syncState requires the remote-dev SERVER side instance\");\n}","typeGuard":"boolean canSyncState(RuntimeUpdatesProcessor p) {\n    return p.getDevModeType() == DevModeType.REMOTE_SERVER_SIDE;\n}","tryCatchPattern":"try {\n    processor.syncState(hashes);\n} catch (RuntimeException e) {\n    if (\"Can only sync state on the server side of remote dev mode\".equals(e.getMessage())) {\n        log.error(\"Target is not the remote-dev server — check launch mode and client URL\");\n    } else throw e;\n}","preventionTips":["Confirm launch mode before calling syncState programmatically","Point sync clients at the server-side URL, never a remote-dev client","Gate custom sync tooling on DevModeType.REMOTE_SERVER_SIDE"],"tags":["remote-dev","dev-mode","lifecycle","state-sync"],"backgroundTag":"wrong-dev-mode-for-operation","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}