canonical / pebble

Pebble is a lightweight Linux service manager with layered configuration and an HTTP API.
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
146 stars 54 forks source link

Cannot find current boot ID error on Google Cloud Run #317

Closed gruyaume closed 12 months ago

gruyaume commented 12 months ago

Bug Description

I'm trying to run a rockcraft build ROCK with a pebble service on Google Cloud Run and I'm getting the following error:

cannot run pebble: fatal: cannot find current boot ID: open /proc/sys/kernel/random/boot_id: no such file or directory

To Reproduce

  1. Create a Cloud Run service with the following container image: northamerica-northeast1-docker.pkg.dev/cognitive-profile/containers/cognitive-profile:0.1.0

Note: You may not be able to reproduce with this specific image without the necessary registry permissions.

Environment

gruyaume commented 12 months ago

I initially created this issue in rockcraft but moved it over here since it looked pebble related. @cjdcordeiro identified those relevant files: https://github.com/search?q=repo%3Acanonical%2Fpebble%20boot_id&type=code

benhoyt commented 12 months ago

It looks like Pebble reads /proc/sys/kernel/random/boot_id on startup to fetch the unique boot ID, and fails hard if it can't read that. That proc file is documented here as part of the Linux kernel docs, so I would have thought any Linux kernel would have that file -- I'm not sure what kernel version it was added in, though. What is the base image here, and what kernel and kernel version is it using? It might help if we could see your rockcraft.yaml.

gruyaume commented 12 months ago

You can see the rockcraft.yaml here:

Cloud Run is Google Cloud's serverless offering so I have no idea what kernel is behind it

gruyaume commented 12 months ago

I've just seen this post about Cloud Run's execution environment, I'll try running the ROCK with the second env instead of the default one: https://cloud.google.com/run/docs/about-execution-environments

gruyaume commented 12 months ago

Indeed, using the "second environment" solves the issue.

benhoyt commented 12 months ago

Excellent, good find and link. Closing this issue for now then.