docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 117 forks source link

Python project does not running on docker container. Warn: Linux kernel reports no Time Stamp Counter (TSC). Floating point exception #6457

Open SadriddinDev opened 2 years ago

SadriddinDev commented 2 years ago

Expected behavior

Python project should run without issues.

Actual behavior

I worked on windows and docker desktop for windows before. Project ran in docker container without any issue. Everything was fine. Next I bought mac m1 one month ago. I tried to run docker container in macbook pro. But container did not run. First I edited Dockerfile and used FROM --platform=linux/amd64 ubuntu:14.04 instead of FROM ubuntu:14.04. Next I got different issue:

Warn: Linux kernel reports no Time Stamp Counter (TSC).
qemu: uncaught target signal 8 (Arithmetic exception) - core dumped

Information

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

sadriddin@Sadriddins-MacBook-Pro ~ % /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0017: can a VM be started?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
No fatal errors detected.

Dockerfile:

FROM --platform=linux/amd64 ubuntu:14.04
# FROM ubuntu:14.04
EXPOSE 8080

ENV DEPLOYDIR /deploy
ENV CMSDIR /deploy/cms

# Install dependencies
RUN apt-get -y update && apt-get install -y python-pip python2.7 git pkg-config libfreetype6-dev libpng12-dev libmysqlclient-dev curl libcurl3 libcurl3-gnutls libss2 libevent-dev libzmq-dev libsqlite3-dev sqlite3

RUN sudo apt-get -y update
RUN sudo apt-get -y install python-dev 

# Install boto, python dependencies from archive
WORKDIR $DEPLOYDIR
COPY . $DEPLOYDIR
RUN cp boto.cfg /etc/boto.cfg
RUN tar -xf dist-packages.tar.gz -C /usr/local/lib/python2.7
RUN rm dist-packages.tar.gz
RUN rm boto.cfg

RUN pip install --index-url=http://pypi.douban.com/simple/ PyJWT==1.7.1
RUN pip install --index-url=http://pypi.douban.com/simple/ xlrd
RUN pip install --index-url=http://pypi.douban.com/simple/ pymongo==3.9.0

# Make directories for mongrel2
RUN mkdir $DEPLOYDIR/logs $DEPLOYDIR/run

# RUN sudo dpkg --add-architecture amd64
RUN dpkg -i mongrel2_20170501-1_amd64.deb

RUN mkdir -p /deploy/static
RUN mkdir -p /deploy/static/$1

WORKDIR $DEPLOYDIR

Log message when I run container:

...
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/unixy.c:161) No previous mongrel2 running, continuing on.
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/mongrel2.c:228) All loaded up, time to turn into a server.
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/mongrel2.c:229) -- Starting Mongrel2/1.11.0. Copyright (C) Zed A. Shaw. Licensed BSD.
baseball-1  | 
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/mongrel2.c:230) -- Look in logs/error.log for startup messages and errors.
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [ERROR] (src/unixy.c:56: errno: No such file or directory) Can't chroot to ~/, rerun as root if this is what you want.
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [WARN] (src/mongrel2.c:245: errno: None) Couldn't chroot to ~/, assuming running in test mode.
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/unixy.c:105) Now running as UID:0, GID:0
baseball-1  | Tue, 23 Aug 2022 06:15:16 GMT [INFO] (src/server.c:365) Starting 0MQ with 1 threads.
baseball-1  | Warn: Linux kernel reports no Time Stamp Counter (TSC).
baseball-1  | qemu: uncaught target signal 8 (Arithmetic exception) - core dumped
baseball-1  | Warn: Linux kernel reports no Time Stamp Counter (TSC).
baseball-1  | qemu: uncaught target signal 8 (Arithmetic exception) - core dumped
baseball-1  | ./run.sh: line 16:    35 Floating point exceptionpython cms_server.py $1 local
baseball-1 exited with code 136

!!! Please help me. I am not able to solve this problem more than 1 month. This is very important to me. Any suggestions or advice are also appreciated.

nicks commented 2 years ago

have you tried a newer ubuntu image? Ubuntu 14.04 is fairly old (it was originally supposed to be EOL'd earlier this year but got extended). I wouldn't be surprised if it has issues on Apple Silicon under emulation.

SadriddinDev commented 2 years ago

@nicks project implemented in Ubuntu 14.04. When I try to use newer ubuntu image, I got more issues than before.

chilicheech commented 2 years ago

My python2.7 project runs into the same issue. If I run the same project in python3.6 then it works fine. Due to certain limitations I currently need to run my project in python2.7, even though that version is already EOL'd.

docker-robott commented 1 year ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale