wget returns 403
satan1c
PROOP

5 months ago

og closed unsolved thread:
https://discord.com/channels/713503345364697088/1418192459384750140/1418192459384750140

<@286358120676982784>
> it does seem like that you are getting blocked by their servers as they may not want their contents to be downloaded programmatically
as I mentioned, I'm getting 403, when trying to fetch my API hosted on Railway, but that request never gets to it
and if u'll read convo, me and other user was using that API hosted on Railway to download file just fine, error occurs only when I'm doing that on deploy

Solved

42 Replies

5 months ago

Apologies, seems like I misunderstood. Have you tried requesting your API using https instead of http?


satan1c
PROOP

5 months ago

I'm requesting only with https


5 months ago

The screenshot of the error message in the initial thread shows wget http:// -> moved permanently -> https://. I'll get to my laptop and see if I can reproduce this issue of 403 when requesting your server. Is this currently limited to any path and/or method (such as only an issue with POST)?


satan1c
PROOP

5 months ago

I see, my bad, maybe I didn't changed that when I was using different service

U can see all endpoints and methods with
https://api.satan1c.dev/list

The only limitation, is fetchFile has "auth" check, u can see that in the end of request


satan1c
PROOP

5 months ago

Would be nice if it's just http issue, I'll try to change that rn


satan1c
PROOP

5 months ago

Nope, still error, but now can't see logs

1421822390308180200


5 months ago

Logs may be delayed, I'll try to reproduce it. Does this only happen with wget or in general when trying to download your own file from your own API with a different service?


satan1c
PROOP

5 months ago

I noticed only on deploy


satan1c
PROOP

5 months ago

Cuz… I made that api in first place to roll out new game versions w/o touching repo


5 months ago

I just created two Dockerfiles, one that runs wget during build and one at runtime. The one during build seems to get blocked.


satan1c
PROOP

5 months ago

If postman/insomnia/browser is decent list of "different service", then ye, it's fine there


5 months ago

1421829153170395100
1421829153635701000


satan1c
PROOP

5 months ago

So, I need to fetch that after deployment ? And that's the only way ?


5 months ago

I am unsure if this is the only way, but it is one of the solutions I can currently offer as that seems to work.


satan1c
PROOP

5 months ago

That looks like a bug… Idk if I should report it somehow <:HuTaoThink:830708889141248011>


satan1c
PROOP

5 months ago

Oh, I forgot to mention one thing
Previously I was using different 3rd party service to download, and it was working just fine
So it broke right after I decided to use my own service


satan1c
PROOP

5 months ago

I was using
it doesn't have open API so I was using their internal endpoints used for frontend


5 months ago

I believe that I have managed to fix it and download your zip file during build. Give me a moment, I'll see if I can reproduce it and provide a MRE.


satan1c
PROOP

5 months ago

<:kleewow2:1000604438542700596>


5 months ago

FROM alpine:latest

RUN apk add --no-cache wget

RUN wget \
    --header="User-Agent: Mozilla/5.0 (X11; Linux x86_64)" \
    "https://api.satan1c.dev/utility/fetchFile/dol?post_id=8002475831210169689&linux_dol_web_my=file_fetcher" \
    -O /file.zip

CMD ["echo", "done"]

1421833630593974333


satan1c
PROOP

5 months ago

<:emoji_74:1180205078519496705>


5 months ago

Adding the User-Agent header seems to work.


satan1c
PROOP

5 months ago

so header fixed that ?


satan1c
PROOP

5 months ago

I see, will try now, thx


satan1c
PROOP

5 months ago

hm, failed again, and I can't see logs again


5 months ago

That's odd that you can see any logs, is this also the case with other services you have within Railway, such as your API?


satan1c
PROOP

5 months ago

I can see logs of all other services, but only when that one fails I can't see build logs


satan1c
PROOP

5 months ago

or better to say, I can see logs before build fails


5 months ago

Can you share a screenshot of it?


satan1c
PROOP

5 months ago

ok, I moved unzip higher, so now I see error


satan1c
PROOP

5 months ago

it looks like that, and if I open logs, it looks like that https://discord.com/channels/713503345364697088/1421800290230992979/1421822390555513052

1421836619559866400


satan1c
PROOP

5 months ago

> exit code: 9
<:fake:1180204948512854096>


satan1c
PROOP

5 months ago

well, at least it downloads, ty so much for help


satan1c
PROOP

5 months ago


satan1c
PROOP

5 months ago

ye, got "no logs" again xD

1421837825237717124


satan1c
PROOP

5 months ago

so I can assume it passes unzip now, but fails at CMake step, so I'll need to investigate that on local first <:miyabilay:1381552435293851658>


5 months ago

I'll raise the no build logs issue internally.


satan1c
PROOP

5 months ago

thx


satan1c
PROOP

5 months ago

Actually, issue was "mv" command usage
Now it's perfectly fine

1421847789758845200


satan1c
PROOP

5 months ago


5 months ago

I'll mark this thread as solved!


5 months ago

!s


Status changed to Solved uxuz 5 months ago


Loading...