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

/r6stats - Doesnt work on deployed docker #5

Open
Ki-er opened this issue Sep 2, 2022 · 27 comments · Fixed by #50
Open

/r6stats - Doesnt work on deployed docker #5

Ki-er opened this issue Sep 2, 2022 · 27 comments · Fixed by #50
Labels
bug Something isn't working

Comments

@Ki-er
Copy link
Owner

Ki-er commented Sep 2, 2022

Ref: hmes98318/r6s-stats-api#1 (comment)

R6 stats api doesnt work within deployed docker

More research needs to be carried out for this

@Ki-er Ki-er added the bug Something isn't working label Sep 2, 2022
@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

It works for this input waifu_-. pc and null for type

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

I think it's more like the user has to be registered here: https://r6.tracker.network/

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 15, 2022

Doing the inputs above I get
image

It works in my local development of nodejs, it may work for yours due to the dev.docker but im not sure why it doesnt work for the deployed docker

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

No worries, fix on the way 😬

@G0maa G0maa mentioned this issue Oct 15, 2022
12 tasks
@Ki-er Ki-er closed this as completed in #50 Oct 15, 2022
@Ki-er Ki-er reopened this Oct 15, 2022
@Ki-er
Copy link
Owner Author

Ki-er commented Oct 15, 2022

Still getting undefined

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

Huh... how did you test it? i.e. How did you start docker image?

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

Here's what I tested:
docker compose up
This one worked normally.

2nd option:
docker build .
then:

docker run -d \
--name=clarence \
-p 6002:6002 \
-e DISCORD_TOKEN='INSERT DISCORD TOKEN' \
-e MONGOOSE='INSERT MONGODB URL' \
-e PREFIX='-' \
--restart unless-stopped \
8b020cbc738b (image id)

This also worked normally.

Have you tried rebuilding the image?

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 15, 2022

I ran the docker command seen in the README pulling the latest image. Ill try setting it up using the docker compose and giving it ago

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

Weird... I just tried the one in README it still worked I guess we need some third person to verify.

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 15, 2022

@CrimsonTome, we request your assistance 😆

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 15, 2022

Weird... I just tried the one in README it still worked I guess we need some third person to verify.

What inputs did you try. ill try the same ones

@G0maa
Copy link
Contributor

G0maa commented Oct 15, 2022

Similar to the one in the docs waifu_-., you can try the bot here: https://discord.gg/BfSVskDN

@CrimsonTome
Copy link
Contributor

@CrimsonTome, we request your assistance 😆

If you don't mind waiting til this evening/tomorrow as I'm out most of today

@CrimsonTome
Copy link
Contributor

CrimsonTome commented Oct 16, 2022

It's looking like it doesn't want to work when being ran in Docker in a VM

@CrimsonTome
Copy link
Contributor

CrimsonTome commented Oct 16, 2022

correction: doesnt like being ran in a VM at all, node or docker
os: Ubuntu 22.04
apologies I have no idea how this would be resolved

@hmes98318
Copy link

try to install curl in the docker image may can get some help
hmes98318/r6s-stats-api#1 (comment)

@G0maa
Copy link
Contributor

G0maa commented Oct 16, 2022

Mhm... this might be actually it, because curl doesn't exist on my WSL2 Ubuntu 20.04...

I can't remember if dockerfile can have 2 images i.e. two FROM, but the second option is to have a multi-stage dockerfile.

edit, forgot to link

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 16, 2022

@G0maa
Copy link
Contributor

G0maa commented Oct 16, 2022

gg, I'll try to do it soon_ish_.

@hmes98318
Copy link

Mhm... this might be actually it, because curl doesn't exist on my WSL2 Ubuntu 20.04...

I can't remember if dockerfile can have 2 images i.e. two FROM, but the second option is to have a multi-stage dockerfile.

edit, forgot to link

Add RUN apt-get update -y && apt-get install --no-install-recommends -y curl to your Dockerfile

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 17, 2022

Mhm... this might be actually it, because curl doesn't exist on my WSL2 Ubuntu 20.04...
I can't remember if dockerfile can have 2 images i.e. two FROM, but the second option is to have a multi-stage dockerfile.
edit, forgot to link

Add RUN apt-get update -y && apt-get install --no-install-recommends -y curl to your Dockerfile

This did not fix it

@hmes98318
Copy link

This did not fix it

Where is not solved?
I did not understand. 😕

@Ki-er
Copy link
Owner Author

Ki-er commented Oct 17, 2022

Doing the inputs above I get image

It outputs the above and in console, nothing appears when doing console.log(profile)

@hmes98318
Copy link

hmes98318 commented Oct 17, 2022

It outputs the above and in console, nothing appears when doing console.log(profile)

umm...
Using same Dockerfile to build image is available.

FROM node:16.17.1

WORKDIR /usr/clarence/

COPY --chown=node:node . .

RUN npm --verbose install

RUN apt-get update -y && apt-get install --no-install-recommends -y curl

CMD ["node", "src/index.js"]

image

@CrimsonTome
Copy link
Contributor

this is not a docker issue, this is most likely an issue with it being ran in a VM

@G0maa
Copy link
Contributor

G0maa commented Oct 17, 2022

Hmm... 👀

Just use Axios instead of exec in r6stats... this solves basically everything 😬

** If curl is actually the culprit causing this problem **

@G0maa
Copy link
Contributor

G0maa commented Oct 26, 2022

Could anyone try r6stats now after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants