6

I've been working on a project which I deploy via docker to a raspberry pi in my house. At this point, I'm probably ~10 updates into the process so I have already successfully run my project on docker on my RBP.

The pipeline is that I push my code to Github and a github action/workflow builds and pushes the image to Docker Hub. Then I SSH into my Raspberry Pi manually, pull the image from Docker Hub, and then run it.

Everything was working fine until I just made a few changes to the node app running inside the image. When I pull and run the image on the Raspberry Pi, I get a weird Node error... something about getting the time in microseconds?

Node.js[1]: ../src/util.cc:188:double node::GetCurrentTimeInMicroseconds(): Assertion `(0) == (uv_gettimeofday(&tv))' failed.

Note that I have made no changes to the deployment pipeline or process. Nor have I changed anything in the Dockerifle. The "breaking change" was essentially just re-arranging some express routes in the Node app, which I have un-done and re-deployed to Docker but still get the above error.

What's even more strange is that the image runs completely fine on my Macbook. See the image of two terminals, one ssh into the RBP and one on my Macbook. You can see I'm pulling the same image from dockerhub and running it on each machine with very different results. The Macbook terminal even shows an error because I've compiled the image with buildx to run on arm architecture... but it runs my code anyway.

I've searched for the node error a few different ways but I'm not finding anything. I basically have no idea what is going on and its completely stopped my progress. I've tried updating the Pi itself, turning it off/on, uninstall / reinstall docker, remove all docker images (you can see docker image ls as a command in the RBP terminal), and re-pushing my code to trigger another image build.

Any thoughts would be greatly appreciated! Even just how to get more verbose logs when the docker image is booting up. As you can see in the RBP terminal below, it shows the one error and exits.

Two terminals trying to pull and run the same Docker image

5
  • I know this is not the answer you would expect, but try to run your container in a new microsd installation. I don't know why, but sometimes problems like this hapens to me and after a new raspibian installation everything works fine. Commented Oct 30, 2021 at 5:01
  • 1
    It kind of seems like Node is failing to get a valid time. What are you using as the base image for your Docker image? Does the image have libuv installed? You can also try using strace to check out what system calls are happening under the hood. Commented Oct 30, 2021 at 5:53
  • I'll try to get a new raspbian installation, thanks for the suggestion @guilfer! And I'm just using node as the base image (FROM node) and I don't know about libuv. I haven't used strace (very new to docker) but I'll do some research and try to get some better logging. Commented Oct 30, 2021 at 22:07
  • 1
    I believe I have fixed the issue by changing the base docker image to node:14-alpine. Not sure why this fixed it, but for anyone finding this issue it is worth a shot! Commented Oct 31, 2021 at 22:06
  • I've just found this image is unreliable. I didn't chase a solution as I went in another direction Commented Nov 9, 2021 at 2:07

2 Answers 2

4

Have you tried running the docker container with the argument --security-opt seccomp:unconfined?

I got this same error message on my Raspberry Pi. It triggered every time I ran either node or npm on any node image I could find. When I tried to dig deeper to investigate why that uv_gettimeofday(&tv) would fail inside the container I noticed that apt update was broken as well as described here:

https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm

The solution to that issue, applying --security-opt seccomp:unconfined, when running the docker container, solved not just my apt problem but also my node and npm issue as well.

As for the underlying root cause to why seccomp settings would affect uv_gettimeofday, I have no idea.

Sign up to request clarification or add additional context in comments.

Comments

0

I run into this problem with docker baseimage node:16.15.1-bullseye-slim, then I fallback to node:16.15.1-buster-slim, it works fine then.

Check updates at https://github.com/nodejs/docker-node/issues/1746

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.