Error setting my openclaw
kameroongod
FREEOP

3 months ago

When i try to Run setup I get these logs:

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

at ServerResponse.setHeader (node:_http_outgoing:700:11)

at ServerResponse.json (/app/node_modules/express/lib/response.js:249:10)

at ServerResponse.header (/app/node_modules/express/lib/response.js:686:10)

at file:///app/src/server.js:874:37

at ServerResponse.json (/app/node_modules/express/lib/response.js:249:10)

at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {

at file:///app/src/server.js:880:28

at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

[/setup/api/run] error: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

at ServerResponse.setHeader (node:_http_outgoing:700:11)

at ServerResponse.header (/app/node_modules/express/lib/response.js:686:10)

I tried with MiniMax and OpenRouter API keys, no luck. With and without telegram and no luck as well..

$10 Bounty

20 Replies

3 months ago

For the OpenClaw template, double check the doc setup bits:HTTP Proxy port = 8080, ...volume mounted at /data, and SETUP_PASSWORD set. After fixing those, redeploy and try /setup again.


kameroongod
FREEOP

3 months ago

I have all already.. both the settings and volume mounted at /data


kameroongod

I have all already.. both the settings and volume mounted at /data![](https://station-server.railway.com/attachments/att_01khqm4714fk7scdwngtxh7ehp)![](https://station-server.railway.com/attachments/att_01khqm5cthfvkspm2gafnw396t)

3 months ago

can you also confirm the service Networking -> HTTP Proxy is enabled and set to 8080


3 months ago

Make sure OPENCLAW_STATE_DIR and OPENCLAW_WORKSPACE_DIR are inside /data as well


dharmateja

Make sure OPENCLAW\_STATE\_DIR and OPENCLAW\_WORKSPACE\_DIR are inside /data as well

kameroongod
FREEOP

3 months ago

They are both under /data

and here's my proxy


kameroongod

They are both under /data ![](https://station-server.railway.com/attachments/att_01khqmwa7jf269gjvrak1765kd) and here's my proxy![](https://station-server.railway.com/attachments/att_01khqmv04wecwvcys6a3676tp0)

3 months ago

Change OPENCLAW_STATE_DIR to /data/.openclaw not .clawdbot

https://docs.openclaw.ai/install/railway#variables


dharmateja

Change `OPENCLAW_STATE_DIR` to `/data/.openclaw ` not .clawdbot <https://docs.openclaw.ai/install/railway#variables>

3 months ago

Then Redeploy, then re-run /setup


dharmateja

Then Redeploy, then re-run `/setup`

kameroongod
FREEOP

3 months ago

=/

new config:

same logs:


kameroongod

\=/ new config: ![](https://station-server.railway.com/attachments/att_01khqpkh16f6cajsj2j977wr2t) same logs: ![](https://station-server.railway.com/attachments/att_01khqpj87kfk7sce0e4bkxzkep)

3 months ago

can you share the log lines before ERR_HTTP_HEADERS_SENT?


dharmateja

can you share the log lines before ERR\_HTTP\_HEADERS\_SENT?

kameroongod
FREEOP

3 months ago

my full logs since redeploying and trying again

Attachments


kameroongod

my full logs since redeploying and trying again ![](https://station-server.railway.com/attachments/att_01khqqea2deczv58vxvrk5xxbg)

3 months ago

You re deployed right ?


dharmateja

You re deployed right ?

kameroongod
FREEOP

3 months ago

yes


kameroongod

yes

3 months ago

did you try setting up using web UI rather than telegram


dharmateja

did you try setting up using web UI rather than telegram

kameroongod
FREEOP

3 months ago

i am using web UI


kameroongod

i am using web UI ![](https://station-server.railway.com/attachments/att_01khqrajkmfaqt4ckj3tpx7wtp)

3 months ago

Looks like this isn’t a issue from your side .. it’s in the template..../setup/api/run is hitting ERR_HTTP_HEADERS_SENT ... when the setup flow fails mid run and the route ends up trying to respond twice ..(so many users won’t see it if their setup succeeds on the first try)...I’ve opened a PR to fix the handler .

https://github.com/vignesh07/clawdbot-railway-template/


vishwajeetcoderr-dev
FREE

3 months ago

DM me on telegram i will give solution - @python_manager


dharmateja

Looks like this isn’t a issue from your side .. it’s in the template..../setup/api/run is hitting ERR\_HTTP\_HEADERS\_SENT ... when the setup flow fails mid run and the route ends up trying to respond twice ..(so many users won’t see it if their setup succeeds on the first try)...I’ve opened a PR to fix the handler . [https://github.com/vignesh07/clawdbot-railway-template/](https://github.com/vignesh07/clawdbot-railway-template/pull/131)

kameroongod
FREEOP

3 months ago

i see thanks! i'll see if there are other templates i can use as well


kameroongod

i see thanks! i'll see if there are other templates i can use as well

3 months ago

try now.. issue has been fixed


dharmateja

try now.. issue has been fixed

kameroongod
FREEOP

3 months ago

new error now xD

<--- Last few GCs ---> [44:0xa10a000] 6034 ms: Mark-Compact 473.4 (487.1) -> 469.6 (485.6) MB, pooled: 0 MB, 499.47 / 0.00 ms (average mu = 0.430, current mu = 0.015) allocation failure; scavenge might not succeed [44:0xa10a000] 6040 ms: Scavenge (interleaved) 471.7 (485.6) -> 470.9 (489.6) MB, pooled: 0 MB, 2.51 / 0.00 ms (average mu = 0.430, current mu = 0.015) allocation failure; <--- JS stacktrace ---> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory ----- Native stack trace ----- 1: 0xe40d24 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [openclaw] 2: 0x1216be0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [openclaw] 3: 0x1216eb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [openclaw] 4: 0x1444875 [openclaw] 5: 0x145e109 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [openclaw] 6: 0x14327b8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [openclaw] 7: 0x14336e5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [openclaw] 8: 0x140c3be v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [openclaw] 9: 0x186da1c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [openclaw] 10: 0x1dcb476 [openclaw]

Attachments


kameroongod
FREEOP

3 months ago

Ok i figured something with help of chatgpt it works now! Many thanks


Welcome!

Sign in to your Railway account to join the conversation.

Loading...