Error deploying postgres docker database when SQL Log is on

Hi There,

I am hoping someone can help me here. I am trying to publish my project to digital ocean in a staging environment. I encountered an error. I am using Wappler 5.8.2 on Mac M1.

I followed the tutorial here: Managing Cloud Servers with Resource Manager

I get a success message - however Wappler status is red.

My target settings;

I get this error in the browser when I try to post something;

Using NodeJS and PostgreSQL

1 Like

I just received this error - this might be helpful?

@Teodor - any hint/tip here?

I tried creating a new project and tried Linode, Digital Ocean, AWS - but I got the same error every time. It appears that there are issues with the database connection.

Are you using the same SSH key?

Thanks @George. Yes, using the same key.

and how is your database defined? Also as docker on the same server?
You can check the target settings for your staging.

Hi @George,

Yes Docker is on the same server as database.

My server settings

;

Database:

I noticed the database connection under remote project is not ticked - only web server got a tick. - see below.

Although I noticed my SSH key is indicating RED, not sure if this got anything to do with the error?

@George - thanks for looking into it. What I discovered the issue was db remote docker container keeps on restarting due to Fatal error related to db log file. I turned off the log file in the database target setting both for development and staging and redeployed it and it worked. It all working now, but I wonder why can’t I have the log file included?

I suspected indeed a database startup error.

What was the exact error?

Which logs do you mean the docker logs for the database service?

Maybe you just did have enough space on the server?

I checked container logs and the exact error was; "PostgreSQL Database directory appears to contain a database; Skipping initialization

2023-10-06 04:30:31.127 UTC [1] FATAL: could not open log file “/custom_sql_log/postgres_query.log”: No such file or directory".

So I turned off the SQL log and redeployed and it worked.

The log file is not more than 100MB and I had more than 25GB available on the server.

Why did you enable the SQL log in first place? It is a very heavy log of all queries ran, so definitely not recommended for production but just during development.

1 Like

in the next Wappler 6 beta, we will be restricting the SQL logging to be available only for local development targets.

1 Like

Great idea; that will prevent unintentional SQL logging in the production.

It is available now in Wappler 6 beta 12