sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.53k stars 724 forks source link

"error":"pg_dump command failed: ","status":400 #660

Closed YangLiuMZ closed 1 year ago

YangLiuMZ commented 1 year ago

What is the reason for this error when I export to sql: {"error":"pg_dump command failed: ","status":400}

sosedoff commented 1 year ago

What pgweb version? Are you using docker image or running natively? Check the logs?

YangLiuMZ commented 1 year ago

什么pgweb版本?您是使用docker映像还是原生运行?检查日志?

The version I use is Pgweb v0.14.0, which runs natively on Windows and Mac. When exporting sql, errors will be reported, but other export methods can succeed. The log is: 'WARN [0257] http request duration=1.157375ms duration ms=1 method=GET path=/api/export remote_ addr=127.0.0.1 status=400'

sosedoff commented 1 year ago

Hard to say what went wrong on your end, but you could try adding a debug flag --debug to further troubleshoot the code, let me know if that helps. I dont have access to a Windows machine, so have no idea if this specific error only appears on Windows.

YangLiuMZ commented 1 year ago

很难说您那边出了什么问题,但您可以尝试添加调试标志--debug以进一步排除代码故障,如果这有帮助,请告诉我。我无法访问Windows机器,所以不知道这个特定错误是否只出现在Windows上。

This problem also occurred when I installed pgweb on my Mac computer. I asked others to help me with the test, but it also made a mistake. Is this not a common problem? Or for pg_ Dump has other things to pay attention to, because debug also does not prompt valuable information.

sosedoff commented 1 year ago

Ah right, the --debug flag is not very useful at the moment. I totally forgot about that by now.

Though, if pg_dump is the real culprit, you should be able to see something like this in the console?

ERRO[0011] pg_dump command failed                        error="error: exit status 1. output: pg_dump: error: no matching tables were found

^ Thats when you try to dump the table that does not exist.

sosedoff commented 1 year ago

@YangLiuMZ im gonna close for now. If you have any specific instructions on how to reproduce - drop them in here and i'll try my best to address any issues, if there are any.