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

corrupted reference store after powercut #246

Open
robertgzr opened this issue May 13, 2021 · 0 comments
Open

corrupted reference store after powercut #246

robertgzr opened this issue May 13, 2021 · 0 comments

Comments

@robertgzr
Copy link
Contributor

May 11 14:49:08 51f90cb balenad[23254]: time="2021-05-11T14:49:08.870073221Z" level=error msg="layer does not exist, not restoring image sha256:f7942a26d161ae2"
May 11 14:49:08 51f90cb balenad[23254]: time="2021-05-11T14:49:08.873468548Z" level=info msg="stopping event stream following graceful shutdown" error="contexty
May 11 14:49:08 51f90cb balenad[23254]: time="2021-05-11T14:49:08.873626743Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontad
May 11 14:49:09 51f90cb balenad[23254]: Error starting daemon: Couldn't create reference store repository: invalid character 's' looking for beginning of value
May 11 14:49:09 51f90cb systemd[1]: balena.service: Main process exited, code=exited, status=1/FAILURE
May 11 14:49:09 51f90cb systemd[1]: balena.service: Failed with result 'exit-code'.
May 11 14:49:09 51f90cb systemd[1]: Failed to start Balena Application Container Engine.
May 11 14:49:10 51f90cb systemd[1]: balena.service: Service hold-off time over, scheduling restart.
May 11 14:49:10 51f90cb systemd[1]: balena.service: Scheduled restart job, restart counter is at 12.
May 11 14:49:10 51f90cb systemd[1]: Stopped Balena Application Container Engine.
May 11 14:49:10 51f90cb systemd[1]: Closed Docker Socket for the API.
May 11 14:49:10 51f90cb systemd[1]: Stopping Docker Socket for the API.
May 11 14:49:10 51f90cb systemd[1]: Starting Docker Socket for the API.
May 11 14:49:10 51f90cb systemd[1]: Listening on Docker Socket for the API.
May 11 14:49:10 51f90cb systemd[1]: Starting Balena Application Container Engine...

The error originates here:

balena-engine/daemon/daemon.go

Lines 1071 to 1075 in b6b8d35

refStoreLocation := filepath.Join(imageRoot, `repositories.json`)
rs, err := refstore.NewReferenceStore(refStoreLocation)
if err != nil {
return nil, fmt.Errorf("Couldn't create reference store repository: %s", err)
}

/var/lib/docker/overlay/repositories.json contained:

sha256:e94321879d0937e050448936ff3d9ea3b82278bf94466f317b45fdbb086e5f02

a working device had:

{
  "Repositories": {
    "balena/amd64-supervisor": {
      "balena/amd64-supervisor:v9.15.7": "sha256:f7942a26d161ae219177452f024433fd2432d89dcb1cfdc96433e26190f35610",
      "balena/amd64-supervisor@sha256:d619a83ac10f65906dc268abb151b6df5085ad9ec72c91f920acf0ba9bfc47bf": "sha256:f7942a26d161ae219177452f024433fd2432d89dcb1cfdc96433e26190"
    }
  }
}
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

1 participant