Error on first startup after installation: "no such table: pretixmultidomain_knowndomain" #3648
-
Hi, I'm trying to install pretix. After having some issues to install from source (see #3642), I now first tried to install via pip and see if I can get pretix to run. I'm having problems with that. The installation went without error, but when I open the website in the browser I'm getting an "Internal Server Error" and can see the following error in the logs:
(See below for the full error message.) I checked the database and this table does exist in the database. This also means that pretix could connect correctly to the database during the initialization (migration) step. Does someone have an idea why this occurs and what I have to do differently to fix it? EDIT START: Solution Problem solved: The cause was that I have my pretix configuration file in a custom location and the supervisor pretix service could not find this, because I didn't tell it where it was. The solution for me was to add the line Note: During installation pretix did know where its config file was because I did EDIT END I searched other issues and found:
Background informationI installed pretix with the following commands (as the pretix user):
I'm using the following configuration:
And this is my
This is the cronjob I created:
Full error messageThis is the full error message as I can see it in the supervisor logs.
There are also other (shorter) errors about a problem with the pretix_worker:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What happens here is that somehow pretix does not try to connect to your postgres databsae but instead to a sqlite database, that is empty:
A common cause would be your config file being in a location where pretix does not detect it. Try setting the environment variable PRETIX_CONFIG_FILE explicitly with the absolute path. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick reaction(s)! Indeed, the problem was that pretix couldn't read the configuration file during startup. The reason is that I have a custom config file location and did export the environment variable in my I also figured this out earlier this afternoon after reading your comment in #1078 again – this comment made me realize that pretix could read the configuration file during installation and database initialization, but not when it was started as a service. Sorry for not reporting back earlier, I didn't have time before now. Here are more details of my setup, the cause of the error and the solution (maybe it helps other people in case they have the same problem):
SolutionThe solution for me was to add the line
Now it works and I get the welcome page when I open the pretix site in the browser. Don't forget the cronjob!Note: The Pretix installation manual recommends to create a cronjob. This actually also needs to be notified about the configuration file location. This means that instead of 15,45 * * * * export PATH=~/pretix_installation/venv/bin:$PATH && cd ~/pretix_installation && python -m pretix runperiodic I need to use the following cronjob: 15,45 * * * * export PRETIX_CONFIG_FILE=~/pretix_installation/config/pretix.cfg && export PATH=~/pretix_installation/venv/bin:$PATH && cd ~/pretix_installation && python -m pretix runperiodic With an installation according to the Pretix docs, instead of 15,45 * * * * export PATH=/var/pretix/venv/bin:$PATH && cd /var/pretix && python -m pretix runperiodic you'd need to use: 15,45 * * * * export PRETIX_CONFIG_FILE=<PATH_TO_YOUR_pretix.cfg> && export PATH=/var/pretix/venv/bin:$PATH && cd /var/pretix && python -m pretix runperiodic |
Beta Was this translation helpful? Give feedback.
Thanks for your quick reaction(s)!
Indeed, the problem was that pretix couldn't read the configuration file during startup. The reason is that I have a custom config file location and did export the environment variable in my
.bash_profile
correctly, but the supervisor service doesn't recognize this, hence it didn't know where to find the config file.I also figured this out earlier this afternoon after reading your comment in #1078 again – this comment made me realize that pretix could read the configuration file during installation and database initialization, but not when it was started as a service. Sorry for not reporting back earlier, I didn't have time before now.
Here are more det…