Comments (14)
AHA! I found something! the 1st line in that backent_init
log is:
File "/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 603, in temporary_connection, django.db.utils.ProgrammingError: relation "core_user" does not exist
And the error in the Database is:
2022-05-03 13:32:39.193 UTC [69] STATEMENT: SELECT "core_user"."password", "core_user"."last_login", "core_user"."is_superuser", "core_user"."username", "core_user"."first_name", "core_user"."last_name", "core_user"."email", "core_user"."is_staff", "core_user"."is_active", "core_user"."date_joined", "core_user"."id", "core_user"."role_id", "core_user"."home_folder_id", "core_user"."inbox_folder_id", "core_user"."created_at", "core_user"."updated_at" FROM "core_user" WHERE "core_user"."username" = 'admin' LIMIT 21,
2022-05-03 13:32:39.193 UTC [69] ERROR: relation "core_user" does not exist at character 416
Notice the core_user
errors correlate. There is an error creating the core_user
relation in the database, and then the backend fails to read it because core_user
doesn't exist.
from papermerge-core.
@cupracer , awesome research! Thank you!
@gljones2001, can you please confirm if renaming
HOSTNAME
variable toUSE_HOSTNAME
fixes your issue ?
So sorry, I ended up switching to a different software.
from papermerge-core.
I am wondering if this issue is related to docker compose problem you had i.e. #18
Are you trying to access it from another host ?
Do you use TLS ? Is there any proxy in between ?
I am asking because portainer logs complains about TLS (unkown certificate):
level=info msg="] [err: %!s(<nil>)]"
level=info msg="2022/04/27 15:18:42 http: TLS handshake error from 192.168.0.51:55187: remote error: tls: unknown certificate"
level=info msg="2022/04/27 15:44:12 http: TLS handshake error from 192.168.0.51:55558: remote error: tls: unknown certificate"
level=info msg="2022/04/27 15:44:26 proxy error: context canceled"
from papermerge-core.
Hmm, yeah... I am using Ubuntu server 20.04 LTS with docker and Portainer installed. It has no GUI (being server) so I have to use a separate PC to connect to it. I did not change any of the config (Besides the other issue you mentioned), so I don't know what could be causing it.
from papermerge-core.
I am wondering if this issue is related to docker compose problem you had i.e. #18 Are you trying to access it from another host ? Do you use TLS ? Is there any proxy in between ? I am asking because portainer logs complains about TLS (unkown certificate):
level=info msg="] [err: %!s(<nil>)]" level=info msg="2022/04/27 15:18:42 http: TLS handshake error from 192.168.0.51:55187: remote error: tls: unknown certificate" level=info msg="2022/04/27 15:44:12 http: TLS handshake error from 192.168.0.51:55558: remote error: tls: unknown certificate" level=info msg="2022/04/27 15:44:26 proxy error: context canceled"
Ohhhhh I just looked at which log you were talking about. That error is because I am using portainer locally only, and it is using a self-generated TLS certificate. I have to click the "proceed to this site anyways" in chrome when I go to the portainer web portal.
Edit: Also there is no proxy besides Traefik, which is using the config you set up. It is completely vanilla, besides what I fixed in issue #18.
from papermerge-core.
Ok, the issue still happens. I used the new setup, with the HOSTNAME
variable, and it now has the old 404: Page Not Found
error again.
from papermerge-core.
Would this have anything to do with the error?
2022-05-03 13:32:39.193 UTC [69] STATEMENT: SELECT "core_user"."password", "core_user"."last_login", "core_user"."is_superuser", "core_user"."username", "core_user"."first_name", "core_user"."last_name", "core_user"."email", "core_user"."is_staff", "core_user"."is_active", "core_user"."date_joined", "core_user"."id", "core_user"."role_id", "core_user"."home_folder_id", "core_user"."inbox_folder_id", "core_user"."created_at", "core_user"."updated_at" FROM "core_user" WHERE "core_user"."username" = 'admin' LIMIT 21,
2022-05-03 13:32:39.193 UTC [69] ERROR: relation "core_user" does not exist at character 416
from papermerge-core.
Also noticed a bunch of python errors in the backend_init
container:
_papermerge_backend_init_1_logs (2).txt
from papermerge-core.
Also noticed a bunch of python errors in the
backend_init
container: _papermerge_backend_init_1_logs (2).txt
The most important message from the log is this part:
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "db" (172.20.0.6) and accepting
TCP/IP connections on port 5432?
Which means that for some reason it fails to connect to database. In docker compose file, backend_init depends on db. Aparently your database service is not running.
There is an error creating the core_user relation in the database, and then the backend fails to read it because core_user doesn't exist.
core_user
is just one table that was not created because database was not up and running during backend_init
initialization.
from papermerge-core.
Huh. The database is running. I don't know why it would be connecting.
from papermerge-core.
Have you looked into doing something like this: https://docs.docker.com/compose/networking/#links
If you add a link to the backend_init
compose section connecting it to db
, that might help IDK.
from papermerge-core.
Ok, the issue still happens. I used the new setup, with the
HOSTNAME
variable, and it now has the old404: Page Not Found
error again.
I discovered Papermerge today and gave it a try. This setup was started via docker-compose on a dedicated SLES 15 SP3 host. I experienced the same issues as described here during startup ("core_user" missing, db connection refused... seem to be irrelevant here) and also that "404: Page Not Found" error.
I configured "HOSTNAME" in .env as a full-qualified hostname ("somehost.my.domain"). Using the FQDN in the browser lead to that 404 error while using just the short name worked perfectly and presented the login page as expected.
Searching for an explanation revealed that docker-compose just used the local part "somehost" when ${HOSTNAME} was used in docker-compose.yml.
I finally solved this 404 error for my setup and it seems that #22 is broken by design (@ciur):
"HOSTNAME" from the .env file is simply not used if that variable also exists in the shell environment where docker-compose is executed. On my system "HOSTNAME" is set automatically and contains the local part of my system's hostname.
See docker-compose documentation regarding environment variables
You can set default values for environment variables using a .env file, which Compose automatically looks for in project directory (parent folder of your Compose file). Values set in the shell environment override those set in the .env file.
I fixed this by just renaming the variable HOSTNAME to USE_HOSTNAME in .env and docker-compose.yml.
from papermerge-core.
@cupracer , awesome research! Thank you!
@gljones2001, can you please confirm if renaming HOSTNAME
variable to USE_HOSTNAME
fixes your issue ?
from papermerge-core.
Closing the ticket due to inactivity.
from papermerge-core.
Related Issues (20)
- Not an Issue but a general question HOT 1
- Update to Tesseract 5? HOT 4
- mysql broken, docker broken? HOT 3
- Add support for jpeg and png to 3.x HOT 1
- Add frontend localization
- Mounting /app in a docker volume causes issue
- No OCR HOT 4
- Can not login anymore HOT 3
- Papermerge behind Traefik v2 transparent proxy HOT 2
- Backup command returns "django.db.utils.OperationalError: no such table: core_user " and fails HOT 3
- Drag 'n' Drop not working HOT 2
- Exception when opening the Inbox HOT 6
- ARM support HOT 1
- Upgrade from docker image 2.1.9 to 3.0 doesn't seem to work HOT 4
- Error thrown after successful login HOT 5
- Secret Key not working in Docker and wrong port forwarding HOT 2
- create_token.sh throws an error HOT 2
- Feature request: Allow to assign a custom uuid when creating document/folder via REST API HOT 3
- Getting '500 - Internal Server Error' when patching node tags HOT 2
- feat: index document, even if skip OCR is set
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from papermerge-core.