Closed timr11 closed 1 month ago
Hi @timr11! Sorry about the trouble.
It looks like there's possibly several issues.
This was actually fixed two commits ago: https://github.com/dbos-inc/dbos-transact/commit/208c001e4c0f5423594e352c09d63a8ad7321f56
The trick is, the password:
that is set in dbos-config.yaml
is only used for when you run the app locally, not in debug mode. Otherwise it's only typechecked aggressively but otherwise doesn't matter. So the simple workaround for this issue is to set it to virtually any string, like password:''
.
This one I currently don't have an explanation for. Let's see if we can gather more data. I can give you some things to try:
With the proxy running, get psql
on your system and try to run
psql -h localhost -p 2345
Does that work? "Work" here means it looks like a postgres connection that lets you run queries. This connection should not need a password. If it gives you an error message, let us know what it is.
Try resetting VSCode credentials. In your IDE, hit Command + Shift + P. A command palette should pop up. Start typing in "DBOS". You should see
Try Debug from the dashboard.
Run npx dbos-cloud dashboard launch
Go to the URL of the dashboard.
Find a workflow, click on it's workflow uuid and select "Debug this workflow". Normally that takes you to VSCode and starts a debugger. Maybe this way will work better for you. See also: https://docs.dbos.dev/cloud-tutorials/monitoring-dashboard
See if these help? Meanwhile I'll see if anyone else has encountered this ECONNREFUSED error before.
Hi @apoliakov, thank you for your response! On the ECONNREFUSED, I followed your suggestion and was able to connect via psql -h localhost -p 2345
. I'm able to list the tables and run queries on them. I also reset the credentials as you suggested, and still no dice. I tried debugging from the dashboard, I found a workflow, clicked on its ID and selected "Debug this workflow", and it gave me an error in VS Code that the Workflow ID ... not found
. This happens both on Cursor and VS Code.
Thanks @timr11 !
The psql
connection should allow you interactive time travel - item 1 in the recent blog post:
https://www.dbos.dev/blog/database-time-travel . It's a neat capability to try out because it lets you examine past database state using a specific time stamp.
If that works, it means the proxy connection is healthy. But, for some reason, VSCode has trouble finding your workflows. And, to confirm, you have the app's directory open in VSCode, right?
@devhawk mentioned he may have some advanced maneuvers we can try out here. I'll let him opine.
It looks like the debug mode was trying to connect the proxy through IPV6 but the proxy itself serves with IPV4.
The address here ::1
is IPV6
Debug mode error: connect ECONNREFUSED ::1:2345
The proxy listens to 127.0.0.1
which is IPV4
> lsof -i -P -n | grep 2345 debug-pro 18455 timromanski 9u IPv4 0xfbffa68d9ddfcb65 0t0 TCP 127.0.0.1:2345 (LISTEN)
It might have something to do with the underlying config on your laptop. If you try to run npx dbos-sdk debug -x http://127.0.0.1:2345 -u 6cd2dbbc-a258-4572-a8e1-11d29e0c4296
it should succeed.
Meanwhile, we're fixing on our end to make sure the proxy listens to both IPv4 and IPv6. Thanks for reporting this issue!
Hi @apoliakov, thank you for your response! On the ECONNREFUSED, I followed your suggestion and was able to connect via
psql -h localhost -p 2345
. I'm able to list the tables and run queries on them. I also reset the credentials as you suggested, and still no dice. I tried debugging from the dashboard, I found a workflow, clicked on its ID and selected "Debug this workflow", and it gave me an error in VS Code that theWorkflow ID ... not found
. This happens both on Cursor and VS Code.
Regarding this issue, did you delete your DB instance and recreate one? Because time travel information would be cleared when you destroy a DB instance.
Update, I tried again today and it worked! @qianl15 when selecting "Time Travel Debug" it ran npx dbos debug -x postgresql://localhost:2345 -u 7b71c416-a135-47a2-8e6f-cf8c3aae452e
, I see that your fix changed "http://localhost.." to "postgresql://localhost.." so I'm assuming that that did the trick. Thank you for the help, greatly appreciate it! This is really cool
When following the docs for the time traveller debug quickstart, it gave me a schema validation error for the dbos-config.yaml when hitting the "Time Travel Debug" link due to the PGPASSWORD. I set it manually and got a ECONNREFUSED when connecting to the debugger proxy. Spoke with @devhawk about it, repro steps below:
Then I copied over the operations.ts from the tutorial and ran:
Then I navigated to https://timromanski-dbos-time-travel-debugger.cloud.dbos.dev/greeting/tim and saw the application was working. I hit the “Time Travel Debug” link above the GreetingWorkflow, entered the DB password when prompted and selected the workflow ID associated with my website visit from earlier, it ran the following in my terminal:
I set the PGPASSWORD env var in the terminal and reran the command, got:
I checked and saw the proxy server was running:
Would love to get the time traveller debugger working, it's very cool. Help appreciated!
Environment: