Cannot push cache layer to GHCR

I am currently getting a 400 when trying to push a cache layer to Github Container Registry with docker buildx. This issue seems to be reproduced by others as well: https://github.com/docker/buildx/issues/271

docker buildx bake base --push
[+] Building 3.7s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                          0.1s
 => => transferring dockerfile: 238B                                                                                                                                                                                                                                                          0.1s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                             0.1s
 => => transferring context: 2B                                                                                                                                                                                                                                                               0.1s
 => resolve image config for docker.io/docker/dockerfile:1.1.7-experimental                                                                                                                                                                                                                   0.4s
 => CACHED docker-image://docker.io/docker/dockerfile:1.1.7-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44                                                                                                                                              0.0s
 => => resolve docker.io/docker/dockerfile:1.1.7-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/python:3.8.4                                                                                                                                                                                                                               0.3s
 => ERROR importing cache manifest from ghcr.io/data-apis/base:cache                                                                                                                                                                                                                          0.3s
 => [stage-0 1/2] FROM docker.io/library/python:3.8.4@sha256:99307ba08435e9c7cddf3889ad2b2aec24c95272531c3db9ee6ff8939aea288c                                                                                                                                                                 0.0s
 => => resolve docker.io/library/python:3.8.4@sha256:99307ba08435e9c7cddf3889ad2b2aec24c95272531c3db9ee6ff8939aea288c                                                                                                                                                                         0.0s
 => CACHED [stage-0 2/2] RUN --mount=type=cache,target=/root/.cache/pip     pip install record_api==1.2.1                                                                                                                                                                                     0.0s
 => exporting to image                                                                                                                                                                                                                                                                        0.6s
 => => exporting layers                                                                                                                                                                                                                                                                       0.0s
 => => exporting manifest sha256:4e63f12df61ca8e98008438e80150b843a910ff8f4f8765d9934b763abb886ee                                                                                                                                                                                             0.0s
 => => exporting config sha256:a79d89640ec268427404f9bca35ec3a52e70b9e0280429557724e32836d00cde                                                                                                                                                                                               0.0s
 => => pushing layers                                                                                                                                                                                                                                                                         0.4s
 => => pushing manifest for ghcr.io/data-apis/base:1.2.1-0                                                                                                                                                                                                                                    0.2s
 => ERROR exporting cache                                                                                                                                                                                                                                                                     1.5s
 => => preparing build cache for export                                                                                                                                                                                                                                                       0.0s
 => => writing layer sha256:11a88e76431345b48525c4e4d58d497810019f4bafdb5e2bd56dc34a05e09cc3                                                                                                                                                                                                  0.3s
 => => writing layer sha256:5573c4b3094956931fd68c310ae92c9eb1a787f0c77ac2730be9d16cce172d5e                                                                                                                                                                                                  0.1s
 => => writing layer sha256:6c9d897f37302ab8e2202260e76631265ca775bed68b5e6a0510bd09ddbe1fd5                                                                                                                                                                                                  0.1s
 => => writing layer sha256:989e6b19a265d6b8b7934e7ddd7dc07f6e2fc945b3a28dda9b8aecb12cdb30e0                                                                                                                                                                                                  0.1s
 => => writing layer sha256:a50d63766e9acf852b8363c7848473c09ab8bfb1c5964621dd20ba154c07d0ae                                                                                                                                                                                                  0.1s
 => => writing layer sha256:af14b6c2f8785723bceb5964c5dec1f0489b7750e9d4ec671e49bfba15d80a39                                                                                                                                                                                                  0.1s
 => => writing layer sha256:c4d25495f8226de0895993d1a78bb089efec11072bdb23c21cc3e53617e4e50a                                                                                                                                                                                                  0.1s
 => => writing layer sha256:d5f9aee4c996b95b09c62386a23494d5ad6a7e1deb0c2438b240f12a4c38ed8b                                                                                                                                                                                                  0.1s
 => => writing layer sha256:e9afc4f90ab09248d75c8081b6dfba749a7f7efdac704ced7e0ceb506e02fa4a                                                                                                                                                                                                  0.1s
 => => writing layer sha256:ee776f0e36afc19d8b1cf242d59ec0e5950aac4e8a60868a266dbc9515ba06f2                                                                                                                                                                                                  0.1s
 => => writing config sha256:628c554a06ff22b2b0a60640c50a8b440d64985f9aa9e06c1485b1190d12ee50                                                                                                                                                                                                 0.1s
 => => writing manifest sha256:4fae5ebb9b5ef5420de3b6067e8fb0c9bbdbb6fa978921c6cb639b88783392a8                                                                                                                                                                                               0.5s
------
 > importing cache manifest from ghcr.io/data-apis/base:cache:
------
------
 > exporting cache:
------
failed to solve: rpc error: code = Unknown desc = error writing manifest blob: failed commit on ref "sha256:4fae5ebb9b5ef5420de3b6067e8fb0c9bbdbb6fa978921c6cb639b88783392a8": unexpected status: 400 Bad Request
2 Likes