Unclear Instructions how to check if Docker Images build is working - stack-create-site error

I successfully created a Plone6 Volto project using cookiecutter and followed the procedures described in Pone Training 2023.

The project is running locally without errors and now the challenge is to get a deployment to run on a virtual server in the cloud.

I am using the ansible approach and the boilerplate created in the deploy folder of the repo described at Plone Deployment โ€” Plone Training 2024 documentation until step Start the project using the make commands.

The server is running and reachable by ansible for basic operations. I am stuck when it comes to execute the step Creating a New Plone Site make stack-create-site described at Deploying the Project โ€“ Plone Deployment โ€” Plone Training 2024 documentation (and Start the Project โ€“ Plone Deployment โ€” Plone Training 2024 documentation)

I got this error running make stack-create-site in the local deploy folder context:

==> Stack aeme-acsr-de: Create site in context prod 
Error: No such container: ./docker-entrypoint.sh
make: *** [stack-create-site] Error 1

I am guessing there is something wrong with the Docker image creation.

What I did before

In the process before I got this output after setting up the git repo

make stack-deploy
==> Stack aeme-acsr-de: Deploy to context prod 
Updating service aeme-acsr-de_backend (id: jx1t18q3br5knczkztul4cb3t)
image ghcr.io/acsr/aeme-backend:latest could not be accessed on a registry to record
its digest. Each node will access ghcr.io/acsr/aeme-backend:latest independently,
possibly leading to different nodes running different
versions of the image.

Updating service aeme-acsr-de_db (id: pzldfizcmaqjdhj5h7k4zxqcx)
Updating service aeme-acsr-de_traefik (id: jqtza7qz9ffb80k4nsyxlprka)
Updating service aeme-acsr-de_frontend (id: wodhhwc0n3v434l2mxi6adsmh)
image ghcr.io/acsr/aeme-frontend:latest could not be accessed on a registry to record
its digest. Each node will access ghcr.io/acsr/aeme-frontend:latest independently,
possibly leading to different nodes running different
versions of the image.

In the section Create a new project it is mentioned like this:

4. Push to GitHub

Push your commits to the remote repository hosted on GitHub. This command will trigger the GitHub Actions that test the codebase and generate Docker images for the Backend and for the Frontend.

When it comes to Building Docker Images

it says:

Ensure you build the Docker images for the Frontend and Backend servers before deployment. GitHub Actions, configured in .github/workflows/backend.yml and .github/workflows/frontend.yml , facilitate this process.

and an important admonition follows:

Before deploying, push all code changes and ensure GitHub Actions successfully complete their runs. Execute these commands to format the code and run tests:

make format
make i18n
make test

For me the implicit tonality in the training docs is not helpful.

Why? Because we are dancing on multiple floors while deploying (Volto, Backend, Local Machine, Github Actions, Remote Server) it would be great to include the explicit context, where actions take place and where and how the results can be tracked.

When I try to execute some make commands in the deploy folder context, I get get

make format
# output
make: *** No rule to make target `format'.  Stop.

the same for:

make i18n
make test

# and as well (when trying to reinitialize)
make stack-rm
make stack-stop
make stack-start

Any ideas how to make sure the images build process works?

There was also a hint to the Docker Account:

Setting Up Docker

Ensure you're logged into your Docker account as the deployment uses public images.

I am logged in into my local Docker Desktop on macOS Ventura.
But the exact context is missing in the docs text.

  • make docker-setup -> works
  • make docker-info -> results are not dropping any obvious missing things.

I got this error running make stack-create-site in the local deploy folder context:

The make stack-create-site command is essentially

docker exec `docker ps -qf 'name=aeme-acsr-de_backend'|head -n1` ./docker-entrypoint.sh create-site

The part in backticks is trying to look up the id of the currently running container named aeme-acsr-de_backend. The error you got sounds like this container was not found, so the result was empty, and docker tried to interpret ./docker-entrypoint.sh as the id of the container, which is wrong.

What do make stack-status and make stack-logs-backend say about the current state of the deployed services?

Any ideas how to make sure the images build process works?

It makes sense to check that the images were built successfully. If that happened, in Github on the Actions tab you should be able to see successful runs of the Backend CI and Frontend CI workflows, and you should see the resulting images at acsr (Armin Stross-Radschinski) / Packages ยท GitHub

1 Like

Thx for the hints,

The workflows on github were not triggered during initial push in spite of the expectation from the training docs.

I triggered them manually and both failed:

A. The frontend workflow failed during the code analysis in the last 3 steps of 4:

Test Status
Prettier :white_check_mark:
ESLint :x:
i18n :x:
Unit Tests :x:

Annotations

4 errors and 2 warnings

code-analysis

code-analysis Error
Process completed with exit code 1.

code-analysis Error
Process completed with exit code 2.

code-analysis Error
Some specified paths were not resolved, unable to cache dependencies.

code-analysis Error
Process completed with exit code 2.

code-analysis Warning
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-node@v3. For more information see: GitHub Actions: Transitioning from Node 16 to Node 20 - The GitHub Blog.
Show more (Link)

code-analysis Warning
No existing directories found containing cache-dependency-path="frontend/yarn.lock"

This does not reach the release Step

B. The backend workflow completed all steps except the last one release with the following message:

buildx failed with: ERROR: failed to solve: failed to push ghcr.io/acsr/aeme-backend:main: unexpected status from POST request to https://ghcr.io/v2/acsr/aeme-backend/blobs/uploads/: 403 Forbidden

My Next Steps:

The repo at https://github.com/acsr-industrialdesign/aeme-acsr-de exists.

The url https://ghcr.io/v2/acsr is not pointing at the same organisation and the repo aeme-backend does not exists there yet. Need to figure out where to fix that and how to change. I expect it writes either to a github repo or more likely into the docker environment of the vm or a place to store the stuff before use by Ansible.

I come back later on this after grinding down the detailled error messages.

Update

I finally managed to get the CI stuff to run but ending up with failures in the frontend workflow during tests claiming different hashes.

One initial issue was having yarn.lock files excluded from the commits by a user level ~/.gitignore file trying to exclude *.lock files for macOS purposes.
Removing this helped to fix missing yarn.lock entries.

Next nightmare
I had installed yarn 3.7.0 locally but the test logs printed 3.2.3.

Reinstalling yarn, changing to lates yarn (as suggested in a forum 4.0.0-rc.25) did not help during complete recreation from blank folders using cookiecutter-plone-starter and blank fresh github repo.

The version 3.2.3came from the cookiecutter-plone-starter.

After reinstalling and pinning yarnto 3.2.3 this helped to fix the hash issues:

yarn set version 3.2.3

Test:

yarn -v

# output
3.2.3

I am finally almost there except a failure during an i18n test:

1s
Run make i18n-ci
  make i18n-ci
  shell: /usr/bin/bash -e {0}
  env:
    IMAGE_NAME_PREFIX: ghcr.io/acsr-industrialdesign/aeme
    IMAGE_NAME_SUFFIX: frontend
    NODE_VERSION: 20.x
+ yarn i18n
Extracting messages from source files...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Synchronizing messages to pot file...
Synchronizing messages to po files...
Generating the language JSON files...
Merging @plone/volto-slate locales for de
Merging @eeacms/volto-accordion-block locales for de
Merging @kitconcept/volto-slider-block locales for de
Merging @eeacms/volto-matomo locales for de
Merging @plone/volto-slate locales for en
Merging @eeacms/volto-accordion-block locales for en
Merging @kitconcept/volto-slider-block locales for en
Merging @eeacms/volto-matomo locales for en
Merging @eeacms/volto-accordion-block locales for es
Merging @kitconcept/volto-slider-block locales for es
Merging @eeacms/volto-accordion-block locales for it
Merging @eeacms/volto-matomo locales for it
Merging @kitconcept/volto-slider-block locales for nl
Merging @kitconcept/volto-slider-block locales for pt_BR
Merging @eeacms/volto-accordion-block locales for ro
Merging @eeacms/volto-matomo locales for ro
done!
+ git diff '-G^[^\"POT]' --exit-code
diff --git a/frontend/locales/de/LC_MESSAGES/volto.po b/frontend/locales/de/LC_MESSAGES/volto.po
index 49d2e20..f6adc0d 100644
--- a/frontend/locales/de/LC_MESSAGES/volto.po
+++ b/frontend/locales/de/LC_MESSAGES/volto.po
@@ -1,4 +1,4 @@
-# Translation of volto.pot to German
+#. Translation of volto.pot to German
 msgid ""
 msgstr ""
 "Project-Id-Version: Plone\n"
diff --git a/frontend/locales/eu/LC_MESSAGES/volto.po b/frontend/locales/eu/LC_MESSAGES/volto.po
index 984adca..2b3cffc 100644
--- a/frontend/locales/eu/LC_MESSAGES/volto.po
+++ b/frontend/locales/eu/LC_MESSAGES/volto.po
@@ -1,4 +1,4 @@
-# Translation of volto.pot to EU
+#. Translation of volto.pot to EU
 msgid ""
 msgstr ""
 "Project-Id-Version: Plone\n"
diff --git a/frontend/locales/fr/LC_MESSAGES/volto.po b/frontend/locales/fr/LC_MESSAGES/volto.po
index f6050e4..246046b 100644
--- a/frontend/locales/fr/LC_MESSAGES/volto.po
+++ b/frontend/locales/fr/LC_MESSAGES/volto.po
@@ -1,4 +1,4 @@
-# Translation of volto.pot to French
+#. Translation of volto.pot to French
 msgid ""
 msgstr ""
 "Project-Id-Version: Plone\n"
make: *** [Makefile:79: i18n-ci] Error 1
Error: Process completed with exit code 2.

Any ideas where these diff failures are coming from?

The format of the .po files produced by volto's i18n script was updated in i18n polishing by erral ยท Pull Request #5542 ยท plone/volto ยท GitHub. It may be that volto's own .po files need to be updated to use the revised format.

1 Like

@davisagli I visited the pull request you mentioned related to a change to the .po file syntax. I recreated everything from scratch and got the same final i18n sync failure in the frontend build run. (diff exactly the same as above from May 17 comment.

I finally could get the frontend build to work by removing the first lines

#. Translation of volto.pot to [lang]

from the three volto.po files of de, eu, fr folders matching the other languages (no initial comment with leading #.

cookiecutter-plone-starter (cookiecutter Version 2.6.0) is now using:
Plone Version (6.0.11), Volto Version (17.17.0) and Volto Generator Version (8.1.4)

macOS Sonoma on Apple Silicon M1 and Python 3.12.4

other tools:

List currently locally installed versions of Plone CI fullstack tools

  • python3.12 version: Python 3.12.4
  • pipx version: 1.6.0
  • nvm version: 0.39.5
  • npm version: 10.8.1
  • node version: v20.15.0
  • yarn version: 1.22.22
  • make version: GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0
  • gmake version: GNU Make 4.4.1 Built for aarch64-apple-darwin23.0.0 Copyright (C) 1988-2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.