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

[BUG]開発用コンテナが正常終了しない #16

Closed
Tracked by #68
h-takeyeah opened this issue Mar 23, 2024 · 2 comments · Fixed by #100
Closed
Tracked by #68

[BUG]開発用コンテナが正常終了しない #16

h-takeyeah opened this issue Mar 23, 2024 · 2 comments · Fixed by #100
Assignees

Comments

@h-takeyeah
Copy link
Collaborator

というバグです。正常終了すればExited (0)と出るはずですがtyping-server-api-1コンテナの場合はExited (137)です。何度やってもそうです。私はコンテナがdockerdからの終了命令に反応しないのでdockerdに強制終了されているのではないかと睨んでいます。

症状

cd typing-server
docker compose -f docker-compose.dev.yml up

image

@KinjiKawaguchi@Tsuyopon-1067 お願いしたいです

@h-takeyeah
Copy link
Collaborator Author

どのコミットでの話か書いてなかった。これです 87aebc5

環境は

Windows 10 Pro 22H2

WSLを使っていて、そのバージョンは

WSL バージョン: 2.1.5.0
カーネル バージョン: 5.15.146.1-2
WSLg バージョン: 1.0.60
MSRDC バージョン: 1.2.5105
Direct3D バージョン: 1.611.1-81528511
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows バージョン: 10.0.19045.4170

で、Ubuntu は22.04LTSでDockerのバージョンは25.0.3、Docker Composeのバージョンはv2.24.6-desktop.1でした。

2024-03-23 12:49
projects/su-its-typing/typing-server  develop [$] ➜ docker compose -f docker-compose.dev.yml up --build
[+] Building 2.1s (17/17) FINISHED                                                                                                                                           docker:default
 => [api internal] load build definition from Dockerfile                                                                                                                               0.0s
 => => transferring dockerfile: 653B                                                                                                                                                   0.0s
 => [api internal] load metadata for docker.io/library/alpine:latest                                                                                                                   1.8s
 => [api internal] load metadata for docker.io/library/golang:1.22.0                                                                                                                   0.0s
 => [api auth] library/alpine:pull token for registry-1.docker.io                                                                                                                      0.0s
 => [api internal] load .dockerignore                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                        0.0s
 => [api builder 1/5] FROM docker.io/library/golang:1.22.0                                                                                                                             0.0s
 => [api stage-1 1/5] FROM docker.io/library/alpine:latest@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b                                                     0.0s
 => [api internal] load build context                                                                                                                                                  0.0s
 => => transferring context: 169.46kB                                                                                                                                                  0.0s
 => CACHED [api stage-1 2/5] RUN apk --no-cache add ca-certificates                                                                                                                    0.0s
 => CACHED [api stage-1 3/5] RUN apk --no-cache add tzdata                                                                                                                             0.0s
 => CACHED [api stage-1 4/5] WORKDIR /root                                                                                                                                             0.0s
 => CACHED [api builder 2/5] WORKDIR /app                                                                                                                                              0.0s
 => CACHED [api builder 3/5] COPY . .                                                                                                                                                  0.0s
 => CACHED [api builder 4/5] RUN go mod download                                                                                                                                       0.0s
 => CACHED [api builder 5/5] RUN CGO_ENABLED=0 GOOS=linux go build -v -o server ./api/cmd/main.go                                                                                      0.0s
 => CACHED [api stage-1 5/5] COPY --from=builder /app/server .                                                                                                                         0.0s
 => [api] exporting to image                                                                                                                                                           0.0s
 => => exporting layers                                                                                                                                                                0.0s
 => => writing image sha256:81307afb2d5e91173ae392166689a96060d71a9b14b641035a55ef82e42b775d                                                                                           0.0s
 => => naming to docker.io/library/typing-server-api                                                                                                                                   0.0s
[+] Running 2/2
 ✔ Container typing-server-db-1   Created                                                                                                                                              0.0s
 ✔ Container typing-server-api-1  Recreated                                                                                                                                            0.5s
Attaching to api-1, db-1
db-1   | 2024-03-23 03:47:24+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.3.0-1.el8 started.
db-1   | 2024-03-23 03:47:24+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-03-23 03:47:24+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.3.0-1.el8 started.
db-1   | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
db-1   | 2024-03-23T03:47:24.890953Z 0 [System] [MY-015015] [Server] MySQL Server - start.
db-1   | 2024-03-23T03:47:25.248045Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.3.0) starting as process 1
db-1   | 2024-03-23T03:47:25.265900Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
db-1   | 2024-03-23T03:47:25.569400Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
db-1   | 2024-03-23T03:47:26.135729Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
db-1   | 2024-03-23T03:47:26.135803Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
db-1   | 2024-03-23T03:47:26.142784Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db-1   | 2024-03-23T03:47:26.212025Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
db-1   | 2024-03-23T03:47:26.212697Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.3.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
api-1  | 2024/03/23 03:47:35 INFO ent client is opened
api-1  | 2024/03/23 03:47:35 INFO schema is created
api-1  | 2024/03/23 03:47:35 INFO server is running at Addr :8080
api-1  | 2024/03/23 03:48:00 INFO received signal: %s !BADKEY=terminated
db-1   | 2024-03-23T03:48:10.614709Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.3.0).
api-1 exited with code 0
api-1 exited with code 137
db-1   | 2024-03-23T03:48:11.450636Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.3.0)  MySQL Community Server - GPL.
db-1   | 2024-03-23T03:48:11.450664Z 0 [System] [MY-015016] [Server] MySQL Server - end.
db-1 exited with code 0

projects/su-its-typing/typing-server  develop [$] ➜ docker compose -f docker-compose.dev.yml ps -a
NAME                  IMAGE               COMMAND                   SERVICE   CREATED              STATUS                        PORTS
typing-server-api-1   typing-server-api   "./server"                api       About a minute ago   Exited (137) 21 seconds ago
typing-server-db-1    mysql:8.3.0         "docker-entrypoint.s…"   db        12 days ago          Exited (0) 19 seconds ago

※補足: api-1 | 2024/03/23 03:48:00 INFO received signal: %s !BADKEY=terminatedのところでDocker Desktopから停止ボタンを押してコンテナの終了を命令しています。

@h-takeyeah
Copy link
Collaborator Author

先生に借りたサーバでも同様

$ cd docker
$ podman-compose -f compose.yaml -p typing stop api app
typing_app_1
WARN[0010] StopSignal SIGTERM failed to stop container typing_api_1 in 10 seconds, resorting to SIGKILL
typing_api_1

@KinjiKawaguchi KinjiKawaguchi changed the title 開発用コンテナが正常終了しない [BUG]開発用コンテナが正常終了しない Apr 1, 2024
@KinjiKawaguchi KinjiKawaguchi linked a pull request Apr 6, 2024 that will close this issue
@KinjiKawaguchi KinjiKawaguchi mentioned this issue Apr 6, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants