Closed ddanielgal closed 2 years ago
Hi, Did you already have the database created in postgres? Vendure will not create the database if it does not exist already.
Yes, listing the databases in the postgres container gives me the following:
vendure=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+--------+----------+------------+------------+-------------------
postgres | litera | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | litera | UTF8 | en_US.utf8 | en_US.utf8 | =c/litera +
| | | | | litera=CTc/litera
template1 | litera | UTF8 | en_US.utf8 | en_US.utf8 | =c/litera +
| | | | | litera=CTc/litera
vendure | litera | UTF8 | en_US.utf8 | en_US.utf8 |
(4 rows)
In the worker container, DB_DATABASE
env var is set to vendure
.
OK. And what's the value of process.env.NODE_ENV
at runtime?
NODE_ENV=production
OK, I think that is the reason. This config line:
synchronize: !isProd, // turn this off for production
means that the DB structure will not be synchronized when in prod mode, which is why none of the tables are being created.
You were right. Setting NODE_ENV=development
for an initial run did start up the worker successfully. After this initial run, I stopped the worker, set NODE_ENV=production
again and it started without errors this time.
Thank you for your help!
I am trying to run the worker container part of this containerized example in kubernetes, in production mode. The database in question is a brand new empty postgres database launched from the postgres:11 docker image.
I am using the latest Vendure version (1.3.2)
The full error message in the worker's log:
Did I miss something during the setup or is this some kind of internal error?
My full config: