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

build failure, prestart.sh, docker wont start #33

Closed
mikekay1 opened this issue Apr 18, 2022 · 10 comments
Closed

build failure, prestart.sh, docker wont start #33

mikekay1 opened this issue Apr 18, 2022 · 10 comments

Comments

@mikekay1
Copy link

mikekay1 commented Apr 18, 2022

I have tried everything to install this docker, and its just not working.

I was getting this error at first:

Step 2/6 : RUN rm /app/prestart.sh
 ---> Running in 8320fe4e580b
Removing intermediate container 8320fe4e580b
 ---> e5fc24f0d04b
Step 3/6 : COPY kijiji_manager /app/kijiji_manager
COPY failed: file not found in build context or excluded by .dockerignore: stat kijiji_manager: file does not exist
ERROR: Service 'web' failed to build
mikekay@projectdock:~/docker-containers/kijijireposter$ sudo docker-compose up -d
Building web
Sending build context to Docker daemon  4.608kB

And then I copied everything manually and ran the build,

Step 5/5 : ENV MODULE_NAME=kijiji_manager.__main__
 ---> Running in 23f80947e6e1
Removing intermediate container 23f80947e6e1
 ---> e66a87bd6305
Successfully built e66a87bd6305
Successfully tagged kijiji-manager:latest
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 201, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python3.8/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1177, in up
    to_attach = up(False)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1157, in up
    return self.project.up(
  File "/usr/local/lib/python3.8/dist-packages/compose/project.py", line 664, in up
    svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 363, in ensure_image_exists
    self.build(cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1131, in build
    all_events = list(stream_output(build_output, output_stream))
  File "/usr/local/lib/python3.8/dist-packages/compose/progress_stream.py", line 22, in stream_output
    for event in utils.json_stream(output):
  File "/usr/local/lib/python3.8/dist-packages/compose/utils.py", line 50, in split_buffer
    for data in stream_as_text(stream):
  File "/usr/local/lib/python3.8/dist-packages/compose/utils.py", line 26, in stream_as_text
    for data in stream:
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1903, in build
    with open(iidfile) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp37ewcnsp'

Ignoring the error the conatiner started but wont boot with the below:

Checking for script in /app/prestart.sh
There is no script /app/prestart.sh
[2022-04-18 14:23:43 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2022-04-18 14:23:43 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2022-04-18 14:23:43 +0000] [1] [INFO] Using worker: egg:meinheld#gunicorn_worker
[2022-04-18 14:23:43 +0000] [9] [INFO] Booting worker with pid: 9
[2022-04-18 14:23:43 +0000] [9] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'kijiji_manager'
[2022-04-18 14:23:43 +0000] [9] [INFO] Worker exiting (pid: 9)
{"loglevel": "info", "workers": 4, "bind": "0.0.0.0:80", "workers_per_core": 2.0, "host": "0.0.0.0", "port": "80"}
[2022-04-18 14:23:43 +0000] [10] [INFO] Booting worker with pid: 10
[2022-04-18 14:23:43 +0000] [10] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'kijiji_manager'
{"loglevel": "info", "workers": 4, "bind": "0.0.0.0:80", "workers_per_core": 2.0, "host": "0.0.0.0", "port": "80"}
[2022-04-18 14:23:43 +0000] [10] [INFO] Worker exiting (pid: 10)
[2022-04-18 14:23:43 +0000] [1] [WARNING] Worker with pid 10 was terminated due to signal 15
{"loglevel": "info", "workers": 4, "bind": "0.0.0.0:80", "workers_per_core": 2.0, "host": "0.0.0.0", "port": "80"}
[2022-04-18 14:23:43 +0000] [1] [INFO] Shutting down: Master
[2022-04-18 14:23:43 +0000] [1] [INFO] Reason: Worker failed to boot.

Any help would be appreciated!!

@mikekay1 mikekay1 changed the title Where is the prestart.sh script? build failure, prestart.sh, docker wont start Apr 18, 2022
@jackm
Copy link
Owner

jackm commented Apr 18, 2022

Please ensure that you run docker-compose up from the root of the repository.

The error COPY failed: file not found in build context or excluded by .dockerignore: stat kijiji_manager: file does not exist indicates that the kijiji_manager directory was not found relative to where you ran docker-compose from.

@mikekay1
Copy link
Author

Thanks for the quick reply, I did end up doing that and all was well, but container still wont boot let me delete everything and try again.

Removing intermediate container 846ff00f3c04
 ---> c353a1aaa145
Step 6/6 : ENV MODULE_NAME=kijiji_manager.__main__
 ---> Running in d9c43ed7a1a0
Removing intermediate container d9c43ed7a1a0
 ---> 11e3bb17126e
Successfully built 11e3bb17126e
Successfully tagged kijiji-manager:latest
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 201, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python3.8/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1177, in up
    to_attach = up(False)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1157, in up
    return self.project.up(
  File "/usr/local/lib/python3.8/dist-packages/compose/project.py", line 664, in up
    svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 347, in ensure_image_exists
    self.build(cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1131, in build
    all_events = list(stream_output(build_output, output_stream))
  File "/usr/local/lib/python3.8/dist-packages/compose/progress_stream.py", line 22, in stream_output
    for event in utils.json_stream(output):
  File "/usr/local/lib/python3.8/dist-packages/compose/utils.py", line 50, in split_buffer
    for data in stream_as_text(stream):
  File "/usr/local/lib/python3.8/dist-packages/compose/utils.py", line 26, in stream_as_text
    for data in stream:
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1903, in build
    with open(iidfile) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpqvmsqjij'
mikekay@projectdock:~/docker-containers/kijiji-manager$ sudo docker-compose up -d
Creating kijiji-manager_web_1 ... done
mikekay@projectdock:~/docker-containers/kijiji-manager$ 

Ignoring the error, I still get the

ModuleNotFoundError: No module named 'kijiji_manager'

@jackm
Copy link
Owner

jackm commented Apr 18, 2022

What versions of Docker and docker-compose are you using?

@mikekay1
Copy link
Author

mikekay1 commented Apr 18, 2022

Hey man, thanks again for getting back to me so quickly:

mikekay@projectdock:~/docker-containers$ sudo docker version
[sudo] password for mikekay: 
Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        e91ed5707e
 Built:             Mon Mar 21 06:17:35 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       459d0df
  Built:            Mon Mar 21 06:18:08 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
mikekay@projectdock:~/docker-containers$ docker-compose version
docker-compose version 1.28.6, build unknown
docker-py version: 4.4.4
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
mikekay@projectdock:~/docker-containers$ 

@jackm
Copy link
Owner

jackm commented Apr 18, 2022

Could you try updating Docker Compose and/or Docker as well? I feel as though you may have run into this Docker Compose bug.

@mikekay1
Copy link
Author

Yea figured that might be a good thing to try I will post back in a bit, thanks!

@mikekay1
Copy link
Author

pip3 says I already have the latest version for both. I see some other versions slightly higher than mine but I don't believe they are stable branches.

But I will try regardless! :)

@mikekay1
Copy link
Author

mikekay1 commented Apr 18, 2022

Same error as before docker-compose and docker both updates to latest :(

Removing intermediate container 688731e2b9d6
 ---> 69ca8bed3819
Step 6/6 : ENV MODULE_NAME=kijiji_manager.__main__
 ---> Running in ea566594735e
Removing intermediate container ea566594735e
 ---> 7b6014469eb8
Successfully built 7b6014469eb8
Successfully tagged kijiji-manager:latest
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/local/lib/python3.8/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
  File "/usr/local/lib/python3.8/dist-packages/compose/cli/main.py", line 1166, in up
    return self.project.up(
  File "/usr/local/lib/python3.8/dist-packages/compose/project.py", line 664, in up
    svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 364, in ensure_image_exists
    self.build(cli=cli)
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1111, in build
    return builder.build(
  File "/usr/local/lib/python3.8/dist-packages/compose/service.py", line 1948, in build
    with open(iidfile) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpejxl6vkg'

BUT when I run the containerit works fine! Awesome dude! Thank you so much for this wonderful gem. I will add these steps to my troubleshooting next time I have a weird error on a dockerfile/dockercompose container.

Sincerely,

Mike K

@mikekay1
Copy link
Author

mikekay1 commented Apr 18, 2022

I'm not sure if you want me to open a ticket, everything works awesome except I am getting an error on repost:

Cannot repost, ad file /app/instance/user/57788557/1606623344.xml does not exist

I believe its a user permission error but I set it chmod 777 just to make sure, and it didn't help. Can you shed some light? I can open a new ticket if needed...

EDIT: just found out this might be an enhancement in the future all good. I can ask the wife to start creating them through the app if she wants to be able to repost :) Thanks again awesome work! Please let me know where I can donate.

@jackm
Copy link
Owner

jackm commented Apr 18, 2022

I'm not sure if you want me to open a ticket, everything works awesome except I am getting an error on repost:

Cannot repost, ad file /app/instance/user/57788557/1606623344.xml does not exist

I believe its a user permission error but I set it chmod 777 just to make sure, and it didn't help. Can you shed some light? I can open a new ticket if needed...

See this comment

Repository owner deleted a comment from mikekay1 Apr 18, 2022
@jackm jackm closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants