question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(imagebuilder) Circular reference when creating simple AMI builders

See original GitHub issue

A circular resolution error is generated when retrying to generate an AMI building pipeline. I am unable to determine what component of the cdk app has a circular dependency

Reproduction Steps

CDK app can be found at https://github.com/umccr/aws_parallel_cluster/tree/cdk-image-builder/ami

The following steps can generate the error:

# Change to cdk directory from git root
cd ami

# Activate cdk venv
. .venv/bin/activate

# Run cdk ls with context parameters
cdk ls \
 --context ACCOUNT="843407916570" \
 --context REGION="ap-southeast-2" \
 --context TAGS="Key=Stack,Value=ParallelCluster" \
 --context S3_READ_ROLE="github_actions_s3" \
 --context PARENT_IMAGE="ami-04b4a20ee9f67608f" \
 --context INFRASTRUCTURE_TYPE="t2.medium" \
 --context S3_CONFIG_ROOT="s3://umccr-research-dev/parallel-cluster" \
 --context GIT_TAG="2.10.1-1.0.1"

What did you expect to happen?

The cfn template to complete

What actually happened?

jsii.errors.JavaScriptError:
  Error: Resolution error: Resolution error: Unable to resolve object tree with circular reference. Path: /Resources/${Token[ami.parallelClusterImageRecipe.LogicalID.75]}/Properties/components/0/node/host/node/host/node/host/node/host/node/host/node/host/node/host/
node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/
host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/
node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/
host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host..
      at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:35:15)
      at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
      at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
      at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
      at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
      at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
      at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
      at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
      at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
      at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "app.py", line 51, in <module>
    app.synth()
  File "/c/Users/awluc/OneDrive/GitHub/UMCCR/aws_parallel_cluster/ami/.venv/lib/python3.7/site-packages/aws_cdk/core/__init__.py", line 14459, in synth
    return jsii.invoke(self, "synth", [options])
  File "/c/Users/awluc/OneDrive/GitHub/UMCCR/aws_parallel_cluster/ami/.venv/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 125, in wrapped
    return _recursize_dereference(kernel, fn(kernel, *args, **kwargs))
  File "/c/Users/awluc/OneDrive/GitHub/UMCCR/aws_parallel_cluster/ami/.venv/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 319, in invoke
    args=_make_reference_for_native(self, args),
  File "/c/Users/awluc/OneDrive/GitHub/UMCCR/aws_parallel_cluster/ami/.venv/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 362, in invoke
    return self._process.send(request, InvokeResponse)
  File "/c/Users/awluc/OneDrive/GitHub/UMCCR/aws_parallel_cluster/ami/.venv/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 332, in send
    raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: Resolution error: Resolution error: Unable to resolve object tree with circular reference. Path: /Resources/${Token[ami.parallelClusterImageRecipe.LogicalID.75]}/Properties/components/0/node/host/node/host/node/host/node/host/node/host/node/h
ost/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/n
ode/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/h
ost/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/n
ode/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host..
/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/refs.js:129
            throw e;
            ^

Error: Resolution error: Resolution error: Unable to resolve object tree with circular reference. Path: /Resources/${Token[ami.parallelClusterImageRecipe.LogicalID.75]}/Properties/components/0/node/host/node/host/node/host/node/host/node/host/node/host/node/host/no
de/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/ho
st/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/no
de/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/ho
st/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host/node/host..
    at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:35:15)
    at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
    at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
    at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
    at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
    at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
    at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
    at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
    at resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:118:43)
    at Object.resolve (/tmp/jsii-kernel-i9p0s1/node_modules/@aws-cdk/core/lib/private/resolve.js:29:33)
Subprocess exited with error 1

Environment

  • CDK CLI Version : 1.85.0 (build 5f44668)
  • Framework Version: How do I determine the framework version?
  • Node.js Version: v13.11.0
  • OS : WSL2 on Windows 10
  • Language (Version): python 3.7.6

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
skinny85commented, Feb 17, 2021

I’m personally a fan of freezing them all. You can do it very easily with a local variable, here’s an example from a setup.py in one of my projects:

cdk_version = '1.87.1'

setuptools.setup(
    # other properties...

    install_requires=[
        f"aws-cdk.core=={cdk_version}",
        f"aws-cdk.aws_iam=={cdk_version}",
        f"aws-cdk.aws_sqs=={cdk_version}",
        f"aws-cdk.aws_sns=={cdk_version}",
        f"aws-cdk.aws_sns_subscriptions=={cdk_version}",
        f"aws-cdk.aws_s3=={cdk_version}",
        f"aws-cdk.aws_codebuild=={cdk_version}",
        f"aws-cdk.aws_codecommit=={cdk_version}",
        f"aws-cdk.aws_codepipeline=={cdk_version}",
        f"aws-cdk.aws_codepipeline_actions=={cdk_version}",
    ],
0reactions
github-actions[bot]commented, Feb 24, 2021

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Action modules supported by AWSTOE component manager
Image building services, such as EC2 Image Builder, use AWSTOE action modules to help configure the EC2 instances that are used for building...
Read more >
EC2 Image Builder: makes server builds easy! | by Moha Alsouli
As AWS puts it, EC2 Image Builder is a service that makes it easier and faster ... the build before the AMI creation,...
Read more >
c# - Dependency Injection circular dependency when using a ...
If the Builders use functions from ProviderService that use the Builders too, creating a factory is a way to break the cycle (at...
Read more >
aws_emr_cluster | Resources | hashicorp/aws
Provides an Elastic MapReduce Cluster, a web service that makes it easy to process ... List of configurations supplied for the EMR cluster...
Read more >
Automating your custom AMI building with EC2 Image Builder
Adam is going to show us how to build custom EC2 images using EC2 Image Builder, then auto-deploy them to an EKS cluster...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found