expanse icon indicating copy to clipboard operation
expanse copied to clipboard

401 Error after trying authentication. Not sure what is the error.

Open wanburana opened this issue 1 year ago • 13 comments

image

here is the log of the expanse-app-1

> prod
> RUN=prod PORT=1301 node ./controller/server.mjs

update all started
update all completed
server (expanse) started on (localhost:1301)
socket (_lug_mR7qI5qoR3IAAAC) connected
socket (vYQ9_v4VIkiSWYdzAAAD) connected
socket (6_Zt4bbwk35zzZRuAAAF) connected
socket (SD8kRbeB_f_Hb7iUAAAH) connected
update all started
update all completed
socket (iy4uL8s43FAQKQcxAAAJ) connected
update all started
update all completed
update all started
update all completed
update all started
update all completed
update all started
update all completed
socket (TYvYWW6APesuVAPpAAAL) connected
update all started
update all completed
wait-for-it: waiting for db:5432 without a timeout
wait-for-it: db:5432 is available after 0 seconds

and here is the log of expanse-db-1

2023-07-25 19:39:26.843 UTC [1] LOG:  starting PostgreSQL 14.8 (Debian 14.8-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-07-25 19:39:26.844 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-07-25 19:39:26.844 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-07-25 19:39:26.848 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-25 19:39:26.854 UTC [27] LOG:  database system was shut down at 2023-07-25 19:38:32 UTC
2023-07-25 19:39:26.859 UTC [1] LOG:  database system is ready to accept connections
2023-07-25 19:39:27.227 UTC [34] LOG:  incomplete startup packet

PostgreSQL Database directory appears to contain a database; Skipping initialization

wanburana avatar Jul 25 '23 19:07 wanburana

did you find a solution? i can seem to figure it out

koksszef avatar Sep 29 '23 17:09 koksszef

did you find a solution? i can seem to figure it out

nothing works for me yet

wanburana avatar Sep 29 '23 17:09 wanburana

Similar issue here. Identical DB logs with slightly different error thrown by Reddit when trying to authenticate.

Edit: Potentially same as #2 and #7.

dd-ugm avatar Oct 02 '23 13:10 dd-ugm

As I'm writing this I would like to express a sincere apology for being of topic and pinging you after ~6months of inactivity on this. @wanburana @pinkneonsign @jc9108. But I would really like to set this up but I'm having an incredibly hard time figuring it out. I don't any real history with stuff like this but having all my saved post from reddit available to me is too tempting. I'm just wondering if you could explain it to me here or maybe through a dm on discord or something. Getting stuck with the docker specifically, can't seem to make it work. Any help or response would be highly appreciated.

Anon-Anon443 avatar Dec 17 '23 00:12 Anon-Anon443

I have the same issue. Docker is working normally and the expanse container is running.

aravezskinteeth avatar Mar 01 '24 19:03 aravezskinteeth

I had the same error, tried it with a different reddit acount ad it worked. I thought it was because the first account was perma banned.

The first account had both capital and small letters, the second username was all small letters, so I copied the first account name exactly as it was, then it worked.

TLDR: I think the username is case sensitive.

abosaad11 avatar May 11 '24 00:05 abosaad11

Hey man thank you for replying! Its been some time since I stopped trying with it but I think my problem was that I just couldn't get the reddit app thing to work and when I was creating the container it was giving me some gibberish string of letters and numbers. If you could spare me some time I would to get in touch to help me clear some things out! Discord: Mkolev#8866

Anon-Anon443 avatar May 11 '24 09:05 Anon-Anon443

i guess theres likely something wrong with your allow/deny lists


someone dm'd me on reddit and said they did

ALLOWED_USERS=""
DENIED_USERS="*"

and that they were getting this 401. yes, because this states that there are no allowed users


and as @abosaad11 said, usernames in these lists are case-sensitive. please read the instructions carefully https://github.com/aplotor/expanse/blob/da454c58854531b1a20a088c8414541bfa76f7eb/backend/.env_example#L13

aplotor avatar Jun 28 '24 02:06 aplotor

@Anon-Anon443 your problem seems unrelated to this issue, and seems like a docker setup issue likely unrelated to expanse. you can try asking chatgpt or r/docker etc

aplotor avatar Jun 28 '24 02:06 aplotor

Thank you all for the responses, after trying to set it up again I succeeded, I think the last time I was trying to do something absolutely unnecessary. Just two more questions to ease my heart, just to know. Reddit keeps the last 1000 saved post/comments but it shows me only 852 items. Does it pull only the currently saved ones from reddit archives them and then adds the new ones I save. Can I get back my older saves somehow or are they lost forever? And do I have to keep the docker activated all the time, or maybe activate it periodically so it can update? The latter I presume. Thank you again. <3

Anon-Anon443 avatar Jun 30 '24 16:06 Anon-Anon443

it shows me only 852 items

see https://github.com/aplotor/expanse/issues/46#issuecomment-2154007340


do I have to keep the docker activated all the time

this is a web app that runs in a docker container, so whenever you want to use it or want it to pull new data, docker needs to be running. generally people keep webapps up 24/7 but its up to you

aplotor avatar Jun 30 '24 17:06 aplotor

I'm getting a 401 as well, no matter what I do. I've combed through my .env_prod file to make sure I have it right. Copied and pasted my Reddit username to ensure case-sensitivity. For allow/deny-lists, I've tried the following:

ALLOWED_USERS="<name1>"
DENIED_USERS="*"
ALLOWED_USERS="<name1>, <name2>, <name3>"
DENIED_USERS="<name4>"
ALLOWED_USERS="*"
DENIED_USERS="<name4>, <name5>, <name6>"

And many variations thereof. None work. I thought for sure the last one would do it, since it's allowing all. Any ideas?

zolinone avatar Jul 26 '24 17:07 zolinone

Hey guys, as I said before I managed to set up the docker and got the thing up and running. But today I tried to start it up and it seems that something has changed(for the record I havent touched absolutely anything related to it). I running the run.sh but it gave me this error:

sh ./run.sh prod up app Pulling app Error Head "https://ghcr.io/v2/jc9108/expanse/manifests/latest": denied Error response from daemon: Head "https://ghcr.io/v2/jc9108/expanse/manifests/latest": denied ./run.sh: line 28: source: filename argument required source: usage: source filename [arguments]

After running it through GPT it said I needed to login from the docker with a github access token so I did with this line:

echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin

But now it continues to give me another error which is:

sh ./run.sh prod up app Pulling app Error manifest unknown Error response from daemon: manifest unknown

Which I guess means that it wont be supported anymore??? Like the app/image or whatever its trying to pull is taken down or cant be found is what I'm understanding from this message. Also to note I have ran sh ./run.sh prod update; whichall it did was somehow remove the expanse app container from the docker image

Your help is greatly appreciated! <3

Anon-Anon443 avatar Aug 29 '24 11:08 Anon-Anon443