Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSRF error when behind Traefik after update to v1.7 #2622

Closed
1 task done
MattInternet opened this issue May 6, 2022 · 5 comments
Closed
1 task done

CSRF error when behind Traefik after update to v1.7 #2622

MattInternet opened this issue May 6, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@MattInternet
Copy link

App Name

paperless-ng

SCALE Version

22.02.0

App Version

1.7.0_2.0.24

Application Events

2022-05-06 11:25:07
Started container paperless-paperless-ng
2022-05-06 11:25:07
Created container paperless-paperless-ng
2022-05-06 11:25:06
Container image "tccr.io/truecharts/paperless-ng:v1.7.0@sha256:b6313bf97da186a84f0faf46ea54ee6ec6568e7fc7fdc1451875777188f4b447" already present on machine
2022-05-06 11:24:44
Started container paperless-redis
2022-05-06 11:24:43
Started container paperless-postgresql
2022-05-06 11:24:43
Created container paperless-redis
2022-05-06 11:24:43
Created container paperless-postgresql
2022-05-06 11:24:40
Container image "ghcr.io/truecharts/redis:v6.2.7@sha256:e5b5c8bd33778d3f7907e88c57b5d8ba85503f8641dcef9f3439e9ecea051f88" already present on machine

Application Logs

2022-05-06 17:25:13.394326+00:0011:25:13 [Q] INFO Process-1:7 pushing tasks at 106
2022-05-06 17:25:13.394347+00:0011:25:13 [Q] INFO Process-1:6 monitoring at 105
2022-05-06 17:25:13.394826+00:0011:25:13 [Q] INFO Q Cluster apart-september-arizona-mike running.
2022-05-06 17:25:14.395854+00:002022-05-06 11:25:14,395 INFO success: consumer entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-05-06 17:25:14.395934+00:002022-05-06 11:25:14,395 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-05-06 17:25:14.395975+00:002022-05-06 11:25:14,395 INFO success: scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-05-06 17:25:42.998857+00:0011:25:42 [Q] INFO Enqueued 1
2022-05-06 17:25:42.998916+00:0011:25:42 [Q] INFO Process-1 created a task from schedule [Train the classifier]
2022-05-06 17:25:43.001118+00:0011:25:43 [Q] INFO Enqueued 1
2022-05-06 17:25:43.001174+00:0011:25:43 [Q] INFO Process-1 created a task from schedule [Check all e-mail accounts]
2022-05-06 17:25:43.028657+00:0011:25:43 [Q] INFO Process-1:1 processing [seven-cold-delta-football]
2022-05-06 17:25:43.029063+00:0011:25:43 [Q] INFO Process-1:2 processing [jersey-echo-yellow-hotel]
2022-05-06 17:25:43.178876+00:0011:25:43 [Q] INFO Process-1:1 stopped doing work
2022-05-06 17:25:43.227575+00:0011:25:43 [Q] INFO Processed [seven-cold-delta-football]
2022-05-06 17:25:43.519390+00:0011:25:43 [Q] INFO recycled worker Process-1:1
2022-05-06 17:25:43.519988+00:0011:25:43 [Q] INFO Process-1:8 ready for work at 110

Application Configuration

The only relevant part here is that I tried setting PAPERLESS_URL both via the field under Container Configuration as well as manually under Configure Image Environment. The formal of the url was https://paperless.domain.com

Describe the bug

The latest paperless-ng update (to v1.7) appears to have broken installs that are behind Traefik.
The project has posted an issue that explains how to fix it here: paperless-ngx/paperless-ngx#712
I also saw that the chart has an explicit PAPERLESS_URL input but unfortunately putting a value in there or adding it manually does not set the env var in the paperless-ng container.
I confirmed this by going into the container with the shell and just trying echo $PAPERLESS_URL after both methods

To Reproduce

  1. Setup paperless-ng at v1.6 and DO NOT set PAPERLESS_URL (it isnt required for 1.6)
  2. Put that instance behind Traefik at a domain
  3. Upgrade the install to v1.7
  4. You should be able to get to the login page but logging in results in an error page explaining that there is a CSRF issue
  5. Adding PAPERLESS_URL either in the provided field in the App questions or "manually" via Configure Image Environment does not appear to actually set it within the paperless-ng container

Expected Behavior

Setting PAPERLESS_URL via the App questions or Configure Image Environment should result in the variable being set in the paperless-ng container

Screenshots

.

Additional Context

.

I've read and agree with the following

  • I've checked all open and closed issues and my issue is not there.
@MattInternet MattInternet added the bug Something isn't working label May 6, 2022
@MattInternet
Copy link
Author

Using kubectl to just describe the deployment i can see there isnt a PAPERLESS_URL also:
Screenshot from 2022-05-06 11-21-10

@MattInternet
Copy link
Author

No idea why but now it is working. I literally added a random variable via Configure Image Environment just to see if i could get it to show up in the deployment description and it not only showed my test variable but also now has PAPERLESS_URL, which was in the App questions spot.

Still seems like there could be a bug where setting the PAPERLESS_URL via the app questions doesnt trigger a change or something?

@stavros-k
Copy link
Member

Could it be you shell'd into the container before it gets shutdown and the new one spawn (so it would have the new env set)?

But considering it DID work at the end. It might or might not be a bug from scale side, but then again, if that was the case, we many users you have problem with env's.

@MattInternet
Copy link
Author

I had tried multiple times so i dont think i could have shell'd in too early. I tried replicating it with another instance and couldnt sooo... 🤷 We can probably close this

@truecharts-admin
Copy link
Collaborator

This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists

@truecharts truecharts locked and limited conversation to collaborators Feb 3, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants