Giter Site home page Giter Site logo

Comments (14)

GraphicHealer avatar GraphicHealer commented on May 20, 2024 2

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024 1

@cupracer , awesome research! Thank you!

@gljones2001, can you please confirm if renaming HOSTNAME variable to USE_HOSTNAME fixes your issue ?

So sorry, I ended up switching to a different software.

from papermerge-core.

ciur avatar ciur commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

Also noticed a bunch of python errors in the backend_init container:
_papermerge_backend_init_1_logs (2).txt

from papermerge-core.

ciur avatar ciur commented on May 20, 2024

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.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

Huh. The database is running. I don't know why it would be connecting.

from papermerge-core.

GraphicHealer avatar GraphicHealer commented on May 20, 2024

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.

cupracer avatar cupracer commented on May 20, 2024

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.

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.

ciur avatar ciur commented on May 20, 2024

@cupracer , awesome research! Thank you!

@gljones2001, can you please confirm if renaming HOSTNAME variable to USE_HOSTNAME fixes your issue ?

from papermerge-core.

ciur avatar ciur commented on May 20, 2024

Closing the ticket due to inactivity.

from papermerge-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.