Closed bigOconstant closed 2 years ago
�[36mlemmy-ui_1 |�[0m No JWT cookie found.
�[36mlemmy-ui_1 |�[0m http://0.0.0.0:1234
�[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie
�[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie
�[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie
Clear your browser cookies for that site. And make sure you don't have browser plugin that might be blocking cookies.
Also make sure you're on 0.12.1
.
�[36mlemmy-ui_1 |�[0m No JWT cookie found. �[36mlemmy-ui_1 |�[0m http://0.0.0.0:1234 �[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie �[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie �[36mlemmy-ui_1 |�[0m Incorrect JWT token, skipping auth so frontend can remove jwt cookie
Clear your browser cookies for that site. And make sure you don't have browser plugin that might be blocking cookies.
Also make sure you're on
0.12.1
.
changed docker-compose from
dessalines/lemmy-ui:0.12.0
to dessalines/lemmy-ui:0.12.1
and dessalines/lemmy:0.12.0
to dessalines/lemmy:0.12.1
Opened a private browser session in firefox with no plugins and I still get the same thing.
You need to have a running nginx for pictures to work at the moment, you do have that set up?
If you're accessing lemmy via :1234
picture uploads won't work.
You need to have a running nginx for pictures to work at the moment, you do have that set up?
If you're accessing lemmy via
:1234
picture uploads won't work.
Ah ok, no I didn't set up nginx. I think that should be more clear in the docs though. Why is it that we need nginx to upload pictures?
We used to require nginx for routing to iframely and pictrs. Now we removed iframely, and we route pictrs requests through lemmy, but we still have to add it to our official API. Once we do this nginx will no longer be necessary for pictures.
In reality it has to do with cross-domain issues... the UI runs on :1234
but the back end is at :8536
. Browsers don't mind cross port websocket, but cross-port HTTP is forbidden. You might be able to try one of those access-control-allow / CORS plugins for FF, that might fix it without nginx for now.
We used to require nginx for routing to iframely and pictrs. Now we removed iframely, and we route pictrs requests through lemmy, but we still have to add it to our official API. Once we do this nginx will no longer be necessary for pictures.
In reality it has to do with cross-domain issues... the UI runs on
:1234
but the back end is at:8536
. Browsers don't mind cross port websocket, but cross-port HTTP is forbidden. You might be able to try one of those access-control-allow / CORS plugins for FF, that might fix it without nginx for now.
interesting. Is most of the api calls going through websockets? I don't see many entries in my network tab. tbh I've never actually used websockets before. So most stuff works because it's going through a websocket, but http request are failing because of cors?
I tried a disable cors addon with no luck. @dessalines would you happen to know how the ui builds the backend url? I'm having a hard time trying to set it. I'm trying to get a reverse proxy with nginx set up but its stuck building it as localhost:8536
when I want it to point to my reverse proxy url.
Use this: https://github.com/LemmyNet/lemmy/blob/main/ansible/templates/nginx.conf
And edit the vars in the {{ }}
as indicated. This all should be in the docker install instructions.
I'm also having this issue on my test instance I set up recently. Its giving me "No JWT cookie found" in lemmy-ui logs. Please let me know if a solution to this is found.
@thepurplerabbit and you are also running nginx? I believe this is explicitly in the docs: https://join-lemmy.org/docs/en/administration/install_docker.html
seems we run into the same problem over ansible install, earlier images dont show either
seems we run into the same problem over ansible install, earlier images dont show either
Can confirm. Example here: https://szmer.info/pictrs/image/gwCBW64PfY.jpg?format=webp&thumbnail=96
in a clean browser, not logged in, the result is just the text: images_disabled
. Nothing in docker-compose logs -f
output.
Non-processed images also fail: https://szmer.info/pictrs/image/gwCBW64PfY.jpg
Uploading images is also broken, uploading an image fails with message in the browser window:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
This instance was running 0.11.3, we upgraded tonight to 0.12.2. No changes in secrets (JWT token in lemmy.hjson
, PostgreSQL passwords in docker-compose.yml
and lemmy.hjson
) - we keep those in local git repositories, so we know if changes happen and when.
The instance was deployed using the Ansible playbook from the official repo, and is using NginX configured by that playbook.
@rysiekpl That's a different issue, because you didn't follow the upgrade notes.
@rysiekpl That's a different issue, because you didn't follow the upgrade notes.
Do you think maybe it would make sense to add that line to the config.hjson
in ansible/templates
? It's not there: https://github.com/LemmyNet/lemmy/blob/main/ansible/templates/config.hjson
Oops, our bad, thx for catching. I'll add that now.
I was able to fix this issue by adding
pictrs_url: "http://pictrs:8080"
To the lemmy.hjson file
Post your nginx, docker-compose.yml, and lemmy.hjson files. I don't know where the issue is without those.
I am closing this issue because image upload works in docker now because it is configured to go through nginx by default. Instead of going to localhost;1235
go to 0.0.0.0:1236
I am having the same issue, as requrested by @dessalines below is the log from the server:
What could the issue be?
Additionally, I have also installed NGINX the app is running on Apache and NGINX for testing purposes:
Apache: https://mawlz.com/ NGINX: https://mawlz.com:8443/
As you can see on both of the web servers it is not working
@Mawlz Post your nginx, docker-compose.yml, and lemmy.hjson files. I don't know where the issue is without those.
@dessalines Apologies for the wait. See here:
docker-compsoe.yml: https://pastebin.com/sa30NDRn
lemmy.hjson: https://www.toptal.com/developers/hastebin/raw/waqanirowo
nginx.conf https://www.toptal.com/developers/hastebin/raw/ireqamupox
set $proxpass "http://0.0.0.0:1236";
Should be 1235
1236 is only for our dev setups, run in the docker/dev folder, not for deploys.
@dessalines
I only changed it to 1236 per the above fix when the issue was closed.
I have now reverted back to 1235
Apache: https://mawlz.com/ NGINX: https://mawlz.com:8443/
The issue persists.
I have changed nothing else
@Mawlz
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
sudo docker-compose restart pictrs
@dessalines
Yes, this has already been made and it is one of the first steps inside the documentation we followed:
https://join-lemmy.org/docs/en/administration/install_docker.html
I have executed the commands again without the mkdir since the directories are created and there is some content inside of them:
[root@vm2248 [/home/mawlz/lemmy]]# ll total 8 -rw-r--r-- 1 root root 1195 Dec 3 09:00 docker-compose.yml -rw-r--r-- 1 root root 1741 Dec 3 08:59 lemmy.hjson drwxr-xr-x 4 root root 36 Dec 1 17:34 volumes [root@vm2248 [/home/mawlz/lemmy]]# sudo chown -R 991:991 volumes/pictrs [root@vm2248 [/home/mawlz/lemmy]]# sudo docker-compose restart pictrs Restarting lemmy_pictrs_1 ... done [root@vm2248 [/home/mawlz/lemmy]]# cd volumes/ [root@vm2248 [/home/mawlz/lemmy/volumes]]# ll total 4 drwxrwxrwx 4 sssd cpanelphppgadmin 31 Dec 1 17:34 pictrs drwx------ 19 70 root 4096 Dec 1 17:42 postgres c[root@vm2248 [/home/mawlz/lemmy/volumes]]# cd pictrs/ [root@vm2248 [/home/mawlz/lemmy/volumes/pictrs]]# ll total 0 drwxrwxrwx 2 sssd cpanelphppgadmin 6 Dec 1 17:34 files drwxrwxrwx 3 sssd cpanelphppgadmin 21 Dec 1 17:34 sled
What exactly is the UID:GUID 991 since for cPanel servers it seems this is SSSD and cpanel's PHPPostGreAdmin.
If this should be a special user which may be different on your system we can assign it, but 991 is what appears on the ll, for me this step was extremely strange.
Pictrs is run as a non root container. Which is best practice. I assume that number is the id assigned to the user in the pictrs container
It also says 404 not found to https://mawlz.com/pictrs/image , which tells me you didn't set up your nginx properly.
@dessalines
@bigOconstant
I'm not sure this is correct as my system is CentOS 7 with Cpanel and all docker containers are ran by docker who is on the root user, docker containers work in their own environment and the fact that the configuration files are owned by root is not a problem since docker is installed and used by the root user.
As for the directories for pictrs they are owned by 991 which is the user specified in the tutorial, all other directories may be owned by root.
The pictrs/image is giving error 405 which is not 404:
https://mawlz.com:8443/pictrs/image
The correct URL for the NGINX build is with port 8443 on the back. Dessalines I believe you clicked the wrong URL above when you commented it showed 404.
I have changed the UID and GID to mawlz and reran docker, and again the app is not working.
Dessalines, would you by any chance log on to the server and review where this is going wrong?
I can provide the details via a private message on lemmy.ml if you agree
Thanks in advance
I don't have time to do that, but also lemmy won't work at a non-standard port like that.
Found a bug? Please fill out the sections below. 👍
For backend issues, use lemmy
Issue Summary
Using instructions to run lemmy locally found here with docker-compose the image upload feature does not work and the ui complains about missing jwt and so does the backend of lemmy.
Steps to Reproduce
Lemmy logs say,
Technical details
sudo docker-compose logs > lemmy_log.out
.Full log output below,