buchgr / bazel-remote

A remote cache for Bazel
https://bazel.build
Apache License 2.0
594 stars 154 forks source link

Error Target @io_bazel_rules_docker//platforms:image_transition was referenced as a platform, but does not provide PlatformInfo #700

Closed sgowroji closed 8 months ago

sgowroji commented 1 year ago

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3321#018ab594-28c8-4eee-ab66-be1399583a81

Platform : Ubuntu Bazel Remote Cache (:ubuntu: 18.04, 20.04)

Logs:

RROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/c452177aff3ea7c8ea21ee9042ebc31a/external/io_bazel_rules_docker/platforms/BUILD:78:9: in constraint_values attribute of platform rule @io_bazel_rules_docker//platforms:image_transition: '@io_bazel_rules_docker//platforms:image_transition_cpu' does not have mandatory providers: 'ConstraintValueInfo'
(02:32:09) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/c452177aff3ea7c8ea21ee9042ebc31a/external/io_bazel_rules_docker/platforms/BUILD:78:9: in constraint_values attribute of platform rule @io_bazel_rules_docker//platforms:image_transition: '@io_bazel_rules_docker//platforms:image_transition_os' does not have mandatory providers: 'ConstraintValueInfo'
(02:32:09) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/c452177aff3ea7c8ea21ee9042ebc31a/external/io_bazel_rules_docker/platforms/BUILD:78:9: Analysis of target '@io_bazel_rules_docker//platforms:image_transition' failed
(02:32:09) ERROR: /var/lib/buildkite-agent/builds/bk-docker-gdxt/bazel-downstream-projects/bazel-remote/BUILD.bazel:134:16: Target @io_bazel_rules_docker//platforms:image_transition was referenced as a platform, but does not provide PlatformInfo
(02:32:09) ERROR: Analysis of target '//:bazel-remote-image' failed; build aborted

Steps:

git clone -v https://github.com/buchgr/bazel-remote.git
git reset 2bcc2f59e111f71b4de4d84013f8e93a1b981872 --hard
export USE_BAZEL_VERSION=6446607f6eb2ce2b1ff5e5d8d429456dcdfec01f
bazel build //:bazel-remote //:bazel-remote-image

Culprit Found: 87fb4620c6edd0e525d4621ecdca4bd47d69484c

CC Greenteam @comius

comius commented 1 year ago

cc @katre

The culprit seems likely cause.

katre commented 1 year ago

This is the same as https://github.com/bazelbuild/bazel-buildfarm/issues/1446. I guess I need to file an issue against rules_docker.

katre commented 1 year ago

Filed https://github.com/bazelbuild/rules_docker/issues/2275, in the meantime using --@io_bazel_rules_docker//transitions:enable=false to disable the problematic behavior seems to work (but means that the image's architecture attribute is ignored, I don't know if the usage in this project is impacted).

sgowroji commented 8 months ago

Bazel remote CI is green now. Hence we are closing this issue now.

jayeshkotia commented 8 months ago

How to resolve this issue I am unable to find the route map. Can anyone help me what all things I have to add in my project

mostynb commented 8 months ago

@jayeshkotia: https://github.com/bazelbuild/rules_docker is archived and unmaintained, they suggest migrating to rules_oci.