Skip to content

error adding edge from "..." to "...": edge would create a cycle #70

Closed

Description

@ilya-lesikov

Version

werf 1.2.296+

Issue

werf converge suddenly starts producing errors like this:

Error: error building deploy plan: error connecting internal dependencies: error adding dependency: error adding edge from "update/default::ConfigMap:mycm" to "recreate/default:batch:Job:myjob": edge would create a cycle

Reason

New deployment engine (Nelm), activated by default since v1.2.296, cannot ignore mistakes made in your charts that result in the wrong deployment order of your resources. For example, if you have a Job with helm.sh/hook: pre-upgrade that mounts a ConfigMap, but the ConfigMap is a non-hook resource, then your deployment order will be Job > ConfigMap, but it must be vice versa. In the old deployment engine the resources will still be applied in this (wrong) order, but in the new deployment engine this would create a cycle in the underlying graph.

Mitigation

These errors indicate resource ordering mistakes made in resource manifests in your chart. Fixing the order of resources in your chart is the correct solution. Just make sure, that the resource that you depend on (e.g. ConfigMap) is deployed at the same "stage" as the resource with a dependency (e.g. Job), or at an earlier stage. helm.sh/hook and helm.sh/weight or werf.io/weight annotations will help you with that.

Alternatively, you can temporarily revert back to the old engine by export WERF_NELM=0.

Activity

  1. transferred this issue fromwerf/werfon Jul 24, 2024
  2. changed the title [-]error adding edge from "..." to "...": edge would create a cycle[/-] [+]`error adding edge from "..." to "...": edge would create a cycle`[/+] on Mar 31, 2025
  3. locked and limited conversation to collaborators on Mar 31, 2025
  4. converted this issue into a discussion #265 on Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions