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

Failed to run bot base on docker instructions for windows #4808

Closed
kolinchang opened this issue Aug 27, 2016 · 21 comments
Closed

Failed to run bot base on docker instructions for windows #4808

kolinchang opened this issue Aug 27, 2016 · 21 comments

Comments

@kolinchang
Copy link

kolinchang commented Aug 27, 2016

Expected Behavior

Docker builds successfully and volume mounts to the correct locations.

Actual Behavior

Base on installation.md:

running "docker build --build-arg timezone=Europe/London -t pokemongo-bot ." failed with error: One or more build-args [timezone] were not consumed, failing build.

running "docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json -v $(pwd)/web/:/usr/src/app/web/ pokemongo-bot" failed to start bot with following message:

2016-08-27 13:06:07,997 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-27 13:06:08,000 [ cli] [INFO] commit: not found
2016-08-27 13:06:08,001 [ cli] [INFO] Error: No /configs/config.json or specified config
usage: pokecli.py [-h] [-cf CONFIG] -a AUTH_SERVICE [-u USERNAME]
[-ws WEBSOCKET.SERVER_URL]
[-wss WEBSOCKET.START_EMBEDDED_SERVER]
[-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
[-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN]
[-wmax WALK_MAX] [-wmin WALK_MIN] [-k GMAPKEY]
[-e SHOW_EVENTS] [-d DEBUG] [-t TEST] [-du DISTANCE_UNIT]
[-rt RECONNECTING_TIMEOUT] [-hr HEALTH_RECORD]
[-ac FORTS.AVOID_CIRCLES] [-mcs FORTS.MAX_CIRCLE_SIZE]
[-crf FORTS.CACHE_RECENT_FORTS]
[--map_object_cache_time MAP_OBJECT_CACHE_TIME]
[--logging_color LOGGING_COLOR]
[--heartbeat_threshold HEARTBEAT_THRESHOLD]
[--pokemon_bag.show_at_start POKEMON_BAG.SHOW_AT_START]
[--pokemon_bag.show_count POKEMON_BAG.SHOW_COUNT]
[--pokemon_bag.show_candies POKEMON_BAG.SHOW_CANDIES]
[--pokemon_bag.pokemon_info POKEMON_BAG.POKEMON_INFO]
[--alt_min ALT_MIN] [--alt_max ALT_MAX]
[--replicate_gps_xy_noise REPLICATE_GPS_XY_NOISE]
[--replicate_gps_z_noise REPLICATE_GPS_Z_NOISE]
[--gps_xy_noise_range GPS_XY_NOISE_RANGE]
[--gps_z_noise_range GPS_Z_NOISE_RANGE]
[--gps_default_altitude GPS_DEFAULT_ALTITUDE]
[--enable_social ENABLE_SOCIAL]
[--walker_limit_output WALKER_LIMIT_OUTPUT]
pokecli.py: error: argument -a/--auth_service is required

Your FULL config.json (remove your username, password, gmapkey and any other private info)

http://pastebin.com/raw/tz7bKug9

Output when issue occurred

Sending build context to Docker daemon 47.65 MB
Step 1 : FROM alpine
---> 4e38e38c8ce0
Step 2 : ARG BUILD_REPO=PokemonGoF/PokemonGo-Bot
---> Using cache
---> 6c966d32b7e0
Step 3 : ARG BUILD_BRANCH=master
---> Using cache
---> 282bd6abc530
Step 4 : ARG TIMEZONE=Etc/UTC
---> Using cache
---> 2eae6398a4c9
Step 5 : LABEL build_repo $BUILD_REPO build_branch $BUILD_BRANCH
---> Using cache
---> 70d001fcf895
Step 6 : WORKDIR /usr/src/app
---> Using cache
---> 72892d3fa603
Step 7 : VOLUME /usr/src/app/configs /usr/src/app/web
---> Using cache
---> dbd051c2ccf8
Step 8 : ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
Downloading 572 B

---> Using cache
---> 4212116238d2
Step 9 : RUN apk -U --no-cache add python py-pip && apk --no-cache add --virtual .build-dependencies python-dev gcc
make musl-dev git tzdata tar && cp -fa /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/tim
ezone && ln -s locale.h /usr/include/xlocale.h && pip install --no-cache-dir -r requirements.txt && apk del
.build-dependencies && rm -rf /var/cache/apk/* /usr/include/xlocale.h && find / -name '.pyc' -o -name '.pyo' -
exec rm -f {} ;
---> Using cache
---> 9c71fb0bbcaf
Step 10 : ADD http://pgoapi.com/pgoencrypt.tar.gz /tmp/pgoencrypt.tar.gz
Downloading [==================================================>] 243.6 kB/243.6 kB
---> Using cache
---> 4713691dce02
Step 11 : RUN apk --no-cache add --virtual .pgoencrypt-dependencies gcc make musl-dev tar && cat /tmp/pgoencrypt.tar
.gz | tar xzf - -C /tmp && make -C /tmp/pgoencrypt/src && cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encr
ypt.so && apk del .pgoencrypt-dependencies && rm -rf /var/cache/apk/* /tmp/pgoencrypt /tmp/pgoencrypt.tar.gz
---> Using cache
---> 75e00d10895a
Step 12 : ADD https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz /tmp
Downloading [==================================================>] 3.536 MB/3.536 MB
---> Using cache
---> 7fde22682ef4
Step 13 : RUN apk -U --no-cache add --virtual .tar-deps tar && cat /tmp/$BUILD_BRANCH.tar.gz | tar -zxf - --strip-co
mponents=1 -C /usr/src/app && apk del .tar-deps && rm /tmp/$BUILD_BRANCH.tar.gz
---> Using cache
---> a38321b2e980
Step 14 : ENTRYPOINT python pokecli.py
---> Using cache
---> 78325bbc780c
One or more build-args [timezone] were not consumed, failing build.

SKIPED BUILD ARGS AND RUN BOT

2016-08-27 13:06:07,997 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-27 13:06:08,000 [ cli] [INFO] commit: not found
2016-08-27 13:06:08,001 [ cli] [INFO] Error: No /configs/config.json or specified config
usage: pokecli.py [-h] [-cf CONFIG] -a AUTH_SERVICE [-u USERNAME]
[-ws WEBSOCKET.SERVER_URL]
[-wss WEBSOCKET.START_EMBEDDED_SERVER]
[-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
[-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN]
[-wmax WALK_MAX] [-wmin WALK_MIN] [-k GMAPKEY]
[-e SHOW_EVENTS] [-d DEBUG] [-t TEST] [-du DISTANCE_UNIT]
[-rt RECONNECTING_TIMEOUT] [-hr HEALTH_RECORD]
[-ac FORTS.AVOID_CIRCLES] [-mcs FORTS.MAX_CIRCLE_SIZE]
[-crf FORTS.CACHE_RECENT_FORTS]
[--map_object_cache_time MAP_OBJECT_CACHE_TIME]
[--logging_color LOGGING_COLOR]
[--heartbeat_threshold HEARTBEAT_THRESHOLD]
[--pokemon_bag.show_at_start POKEMON_BAG.SHOW_AT_START]
[--pokemon_bag.show_count POKEMON_BAG.SHOW_COUNT]
[--pokemon_bag.show_candies POKEMON_BAG.SHOW_CANDIES]
[--pokemon_bag.pokemon_info POKEMON_BAG.POKEMON_INFO]
[--alt_min ALT_MIN] [--alt_max ALT_MAX]
[--replicate_gps_xy_noise REPLICATE_GPS_XY_NOISE]
[--replicate_gps_z_noise REPLICATE_GPS_Z_NOISE]
[--gps_xy_noise_range GPS_XY_NOISE_RANGE]
[--gps_z_noise_range GPS_Z_NOISE_RANGE]
[--gps_default_altitude GPS_DEFAULT_ALTITUDE]
[--enable_social ENABLE_SOCIAL]
[--walker_limit_output WALKER_LIMIT_OUTPUT]
pokecli.py: error: argument -a/--auth_service is required

Steps to Reproduce

"docker build --build-arg timezone=Europe/London -t pokemongo-bot ."
"docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json -v $(pwd)/web/:/usr/src/app/web/ pokemongo-bot"

Other Information

OS: Windows 10

Branch: dev
Git Commit: f0623bd

Python Version: 2.7.12
Any other relevant files/configs (eg: path files)

@leadboots5
Copy link
Contributor

leadboots5 commented Aug 27, 2016

pokecli.py: error: argument -a/--auth_service is required

I am getting this too on mac, still trying to figure out why it can't find the auth file.

work around: do -af configs/auth.json so it can find it.

@th3w4y
Copy link
Contributor

th3w4y commented Aug 27, 2016

@kolinchang can you also copy&paste output of

docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' 7fde22682ef4

Thanks

@th3w4y
Copy link
Contributor

th3w4y commented Aug 27, 2016

@kolinchang

running "docker build --build-arg timezone=Europe/London -t pokemongo-bot ." failed with error: One or more build-args [timezone] were not consumed, failing build.

it is now TIMEZONE (uppercase)

Step 4 : ARG TIMEZONE=Etc/UTC
---> Using cache
---> 2eae6398a4c9

@th3w4y
Copy link
Contributor

th3w4y commented Aug 27, 2016

@kolinchang you are mentioning that you are in branch dev

if you want to docker build "dev" branch
then use BUILD_BRANCH --build-arg

docker build --build-arg BUILD_BRANCH=dev .

or even:

docker build --build-arg BUILD_BRANCH=f0623bd

Otherwise the default is "master"

Branch: dev
Git Commit: f0623bd

@mjmadsen
Copy link
Contributor

@kolinchang What's your status

@kolinchang
Copy link
Author

kolinchang commented Aug 27, 2016

@th3w4y , @mjmadsen
docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' 7fde22682ef4
gives:

2016-08-27T12:30:32.3502195Z map[build_branch:master build_repo:PokemonGoF/PokemonGo-Bot]

@th3w4y looks like you are right, I'm on master even though I checked out dev
I can also confirm that using build arg TIMEZONE does fix docker build error.

It still looks like it cannot find config.json, also tried -af configs/config.json did not work.

@th3w4y
Copy link
Contributor

th3w4y commented Aug 27, 2016

@kolinchang -af configs/auth.json as @leadboots5 suggested

as for the docker part if you want to build dev in your case you should run
docker build --build-arg BUILD_BRANCH=dev --build-arg TIMEZONE=Europe/London .

@kolinchang
Copy link
Author

@th3w4y just saw your comment, trying now!

@kolinchang
Copy link
Author

kolinchang commented Aug 28, 2016

docker build --build-arg BUILD_BRANCH=dev --build-arg TIMEZONE=Europe/London .
builds successfully.
docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' 7fde22682ef4
2016-08-27T12:30:32.3502195Z map[build_branch:master build_repo:PokemonGoF/PokemonGo-Bot]

I'm running the following to start the bot, can you point out what I am doing wrong?

docker run --name=bot2b60dbd8-3261-47e3-a435-58b96e3831e4-pokego --rm -it -v C:/Users/ko/git/PokemonGo-Bot/configs/config.json:/usr/src/app/configs/config.json -v C:/Users/ko/git/PokemonGo-Bot/web/:/usr/src/app/web/ -v C:/Users/ko/git/PokemonGo-Bot/configs/path.json:/usr/src/app/configs/path.json -v C:/Users/ko/git/PokemonGo-Bot/configs/auth.json:/usr/src/app/configs/auth.json pokemongo-bot -af configs/auth.json -cf configs/config.json

outputs:

2016-08-28 10:07:14,836 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-28 10:07:14,841 [ cli] [INFO] commit: not found
2016-08-28 10:07:14,842 [ cli] [INFO] Error: No /configs/auth.json
2016-08-28 10:07:14,842 [ cli] [INFO] Error: No /configs/config.json
usage: pokecli.py [-h] [-cf CONFIG] [-af AUTH] -a AUTH_SERVICE [-u USERNAME]
[-ws WEBSOCKET.SERVER_URL]
[-wss WEBSOCKET.START_EMBEDDED_SERVER]
[-wsr WEBSOCKET.REMOTE_CONTROL] [-p PASSWORD] [-l LOCATION]
[-lc LOCATION_CACHE] [--forts.spin FORTS.SPIN]
[-wmax WALK_MAX] [-wmin WALK_MIN] [-k GMAPKEY]
[-e SHOW_EVENTS] [-d DEBUG] [-t TEST] [-du DISTANCE_UNIT]
[-rt RECONNECTING_TIMEOUT] [-hr HEALTH_RECORD]
[-ac FORTS.AVOID_CIRCLES] [-mcs FORTS.MAX_CIRCLE_SIZE]
[-crf FORTS.CACHE_RECENT_FORTS]
[--map_object_cache_time MAP_OBJECT_CACHE_TIME]
[--logging.color LOGGING.COLOR]
[--logging.clean LOGGING.CLEAN]
[--heartbeat_threshold HEARTBEAT_THRESHOLD]
[--pokemon_bag.show_at_start POKEMON_BAG.SHOW_AT_START]
[--pokemon_bag.show_count POKEMON_BAG.SHOW_COUNT]
[--pokemon_bag.show_candies POKEMON_BAG.SHOW_CANDIES]
[--pokemon_bag.pokemon_info POKEMON_BAG.POKEMON_INFO]
[--alt_min ALT_MIN] [--alt_max ALT_MAX]
[--replicate_gps_xy_noise REPLICATE_GPS_XY_NOISE]
[--replicate_gps_z_noise REPLICATE_GPS_Z_NOISE]
[--gps_xy_noise_range GPS_XY_NOISE_RANGE]
[--gps_z_noise_range GPS_Z_NOISE_RANGE]
[--gps_default_altitude GPS_DEFAULT_ALTITUDE]
[--enable_social ENABLE_SOCIAL]
[--walker_limit_output WALKER_LIMIT_OUTPUT]
pokecli.py: error: argument -a/--auth_service is required

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

docker build does not take comma separated build-args... correct command is:

docker build --build-arg TIMEZONE=Australia/Melbourne --build-arg
BUILD_BRANCH=dev
-t pokemongo-bot .

On Sun, Aug 28, 2016 at 1:44 AM, kolinchang [email protected]
wrote:

@th3w4y https://github.com/th3w4y You might also be interested to know
that
docker build --build-arg TIMEZONE=Australia/Melbourne,BUILD_BRANCH=dev -t
pokemongo-bot .

running without TIMEZONE gives a similar message;

failed with message:
Sending build context to Docker daemon 47.66 MB
Step 1 : FROM alpine
---> 4e38e38c8ce0
Step 2 : ARG BUILD_REPO=PokemonGoF/PokemonGo-Bot
---> Using cache
---> 6c966d32b7e0
Step 3 : ARG BUILD_BRANCH=master
---> Using cache
---> 282bd6abc530
Step 4 : ARG TIMEZONE=Etc/UTC
---> Using cache
---> 2eae6398a4c9
Step 5 : LABEL build_repo $BUILD_REPO build_branch $BUILD_BRANCH
---> Using cache
---> 70d001fcf895
Step 6 : WORKDIR /usr/src/app
---> Using cache
---> 72892d3fa603
Step 7 : VOLUME /usr/src/app/configs /usr/src/app/web
---> Using cache
---> dbd051c2ccf8
Step 8 : ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/
requirements.txt .
Downloading 572 B

---> Using cache
---> 4212116238d2
Step 9 : RUN apk -U --no-cache add python py-pip && apk --no-cache add
--virtual .build-dependencies python-dev gcc make musl-dev git tzdata tar
&& cp -fa /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE >
/etc/timezone && ln -s locale.h /usr/include/xlocale.h && pip install
--no-cache-dir -r requirements.txt && apk del .build-dependencies && rm -rf
/var/cache/apk/* /usr/include/xlocale.h && find / -name '.pyc' -o -name
'
.pyo' -exec rm -f {} ;
---> Running in a8d3b977ec52
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/
APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/
APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/
APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/
APKINDEX.tar.gz
(1/12) Installing libbz2 (1.0.6-r4)
(2/12) Installing expat (2.1.1-r1)
(3/12) Installing libffi (3.2.1-r2)
(4/12) Installing gdbm (1.11-r1)
(5/12) Installing ncurses-terminfo-base (6.0-r7)
(6/12) Installing ncurses-terminfo (6.0-r7)
(7/12) Installing ncurses-libs (6.0-r7)
(8/12) Installing readline (6.3.008-r4)
(9/12) Installing sqlite-libs (3.13.0-r0)
(10/12) Installing python (2.7.12-r0)
(11/12) Installing py-setuptools (20.8.0-r0)
(12/12) Installing py-pip (8.1.2-r0)
Executing busybox-1.24.2-r9.trigger
OK: 61 MiB in 23 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/
APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/
APKINDEX.tar.gz
(1/26) Upgrading musl (1.1.14-r10 -> 1.1.14-r11)
(2/26) Installing pkgconf (0.9.12-r0)
(3/26) Installing pkgconfig (0.25-r1)
(4/26) Installing python-dev (2.7.12-r0)
(5/26) Installing binutils-libs (2.26-r0)
(6/26) Installing binutils (2.26-r0)
(7/26) Installing gmp (6.1.0-r0)
(8/26) Installing isl (0.14.1-r0)
(9/26) Installing libgomp (5.3.0-r0)
(10/26) Installing libatomic (5.3.0-r0)
(11/26) Installing libgcc (5.3.0-r0)
(12/26) Installing mpfr3 (3.1.2-r0)
(13/26) Installing mpc1 (1.0.3-r0)
(14/26) Installing libstdc++ (5.3.0-r0)
(15/26) Installing gcc (5.3.0-r0)
(16/26) Installing make (4.1-r1)
(17/26) Installing musl-dev (1.1.14-r11)
(18/26) Installing ca-certificates (20160104-r4)
(19/26) Installing libssh2 (1.7.0-r0)
(20/26) Installing libcurl (7.50.1-r0)
(21/26) Installing pcre (8.38-r1)
(22/26) Installing git (2.8.3-r0)
(23/26) Installing tzdata (2016d-r0)
(24/26) Installing tar (1.29-r0)
(25/26) Installing .build-dependencies (0)
(26/26) Upgrading musl-utils (1.1.14-r10 -> 1.1.14-r11)
Executing busybox-1.24.2-r9.trigger
Executing ca-certificates-20160104-r4.trigger
OK: 171 MiB in 47 packages
cp: can't stat '/usr/share/zoneinfo/Australia/Melbourne,BUILD_BRANCH=dev':
No such file or directory
The command '/bin/sh -c apk -U --no-cache add python py-pip && apk
--no-cache add --virtual .build-dependencies python-dev gcc make musl-dev
git tzdata tar && cp -fa /usr/share/zoneinfo/$TIMEZONE /etc/localtime &&
echo $TIMEZONE > /etc/timezone && ln -s locale.h /usr/include/xlocale.h &&
pip install --no-cache-dir -r requirements.txt && apk del
.build-dependencies && rm -rf /var/cache/apk/* /usr/include/xlocale.h &&
find / -name '.pyc' -o -name '.pyo' -exec rm -f {} ;' returned a
non-zero code: 1


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4808 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKfPk9HDvjKS0shcTiZA_Dwt8SvluRLgks5qkMvggaJpZM4Jusg-
.

@kolinchang
Copy link
Author

@th3w4y noted

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

@kolinchang you pasted the output of created and labels of the old build
now you have to inspect the last build based on id or name, for example:

docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' bot2b60dbd8-3261-47e3-a435-58b96e3831e4-pokego

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

@kolinchang

you started with the old image...
can you paste output of your last few lines of your build command?

@kolinchang
Copy link
Author

kolinchang commented Aug 28, 2016

@th3w4y Just realised I have been doing that command wrong.
I think you asked for is this:
docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' pokemongo-bot

2016-08-27T23:51:55.7907495Z map[build_branch:dev build_repo:PokemonGoF/PokemonGo-Bot]

this one looks better to be honest.

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

@kolinchang ok so the build is based on dev now... but your -v (the volumes seems wrong... - not sure) also maybe pass the -a google (or ptc) argument at the end of your run command

@kolinchang
Copy link
Author

@th3w4y I suspect that could the case. ran it without all the -v

docker run --name=bot2b60dbd8-3261-47e3-a435-58b96e3831e4-pokego --rm -it pokemongo-bot -af configs/auth.json -cf configs/config.json

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

@kolinchang maybe just use -v C:/Users/ko/git/PokemonGo-Bot/configs:/usr/src/app/configs (that should cover all the configs)
of course you will need the web volume also...

@kolinchang
Copy link
Author

@th3w4y , you are right! Looks like I'm on the right track. Normally I get this error when docker have no credential for access drive C:. Not today it looks like.

this is still not working for me:
docker run --name=bot1-pokego --rm -it -v C:/Users/ko/git/PokemonGo-Bot/configs:/usr/src/app/configs pokemongo-bot

I will play around for a while and keep you guys updated if I find anything. Thanks for your help!

@kolinchang
Copy link
Author

We should update installation.md for TIMEZONE update though.

@th3w4y
Copy link
Contributor

th3w4y commented Aug 28, 2016

@kolinchang already created PR #4833 for this

@kolinchang
Copy link
Author

@th3w4y restarting computer perhaps just restarting docker fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants