{"record":{"id":"43ae09969e10dbe5","repo":"ethereum/go-ethereum","slug":"you-tried-to-send-payload-method-synchronousl","errorCode":null,"errorMessage":"You tried to send \"${payload.method}\" synchronously. Synchronous requests are not supported by the IPC provider.","messagePattern":"You tried to send \"(.+?)\" synchronously\\. Synchronous requests are not supported by the IPC provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/jsre/deps/web3.js","lineNumber":4856,"sourceCode":"    if(this.connection.writeSync) {\n        var result;\n\n        // try reconnect, when connection is gone\n        if(!this.connection.writable)\n            this.connection.connect({path: this.path});\n\n        var data = this.connection.writeSync(JSON.stringify(payload));\n\n        try {\n            result = JSON.parse(data);\n        } catch(e) {\n            throw errors.InvalidResponse(data);                \n        }\n\n        return result;\n\n    } else {\n        throw new Error('You tried to send \"'+ payload.method +'\" synchronously. Synchronous requests are not supported by the IPC provider.');\n    }\n};\n\nIpcProvider.prototype.sendAsync = function (payload, callback) {\n    // try reconnect, when connection is gone\n    if(!this.connection.writable)\n        this.connection.connect({path: this.path});\n\n\n    this.connection.write(JSON.stringify(payload));\n    this._addResponseCallback(payload, callback);\n};\n\nmodule.exports = IpcProvider;\n\n\n},{\"../utils/utils\":20,\"./errors\":26}],35:[function(require,module,exports){\n/*","sourceCodeStart":4838,"sourceCodeEnd":4874,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/internal/jsre/deps/web3.js#L4838-L4874","documentation":"IpcProvider.send (synchronous request path) checks whether the underlying connection supports writeSync; when it does not (the bundled IPC connection lacks sync writes in this context), any synchronous RPC attempt is rejected with this error. Only asynchronous requests (sendAsync / callback style) are supported over the IPC provider in this state.","triggerScenarios":"Constructing web3 with an IpcProvider over geth.ipc and calling a synchronous method, e.g. web3.eth.getBlockNumber() with no callback while connected via IPC, or console code that expects sync returns over the IPC transport.","commonSituations":"Scripts built against HttpProvider (which supports sync in browsers/node) switched to IPC unix socket for security/performance; version upgrades of web3.js where sync IPC behavior differs; calling sync RPC from a context where the connection object has no writeSync.","solutions":["Use the callback form: web3.eth.getBlockNumber(function(err, n) {...}).","Wrap async calls in a promise/utility if sync-looking code style is needed.","If synchronous behavior is truly required, use the HTTP-RPC provider against the node's HTTP endpoint instead of IPC."],"exampleFix":"// before\nvar n = web3.eth.getBlockNumber(); // throws over IPC\n\n// after\nweb3.eth.getBlockNumber(function (err, n) { console.log(n); });","handlingStrategy":"validation","validationCode":"function assertAsyncCapable(web3) {\n  if (web3.currentProvider.constructor.name === 'IpcProvider') {\n    // only use callback-style requests with this provider\n    return false;\n  }\n  return true;\n}","typeGuard":"function isIpcProvider(p) {\n  return p && typeof p.connection !== 'undefined' && typeof p.path === 'string';\n}","tryCatchPattern":"try { web3.eth.getBlockNumber(); }\ncatch (e) {\n  if (/IPC provider/.test(e.message)) { web3.eth.getBlockNumber(cb); }\n}","preventionTips":["Standardize on callback/Promise style for all RPC calls.","When using IPC transport, audit code paths for sync RPC calls left over from HTTP usage."],"tags":["web3","ipc","sync-vs-async","rpc"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}