Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when customizing the synthetization of the stack #526

Open
clementrey-dev opened this issue Feb 28, 2023 · 1 comment
Open

Error when customizing the synthetization of the stack #526

clementrey-dev opened this issue Feb 28, 2023 · 1 comment
Labels
bug Something isn't working effort-small p1

Comments

@clementrey-dev
Copy link

Hello

I have a stack that is deployed with a customize synthetizer. Especially, I am customizing the propertybucketPrefix. I am basically adding a custom prefix to all assets uploaded.
While synthesizing, I get the error:


..../node_modules/cdk-pipelines-github/src/pipeline.ts:491
        throw new Error(`Template asset hash ${hash} not found.`);

I have the feeling that the local asset path is not defined correctly.
Do you know if there is a workaround ?

Thank you for your help

@kaizencc kaizencc added bug Something isn't working p1 effort-small labels Mar 2, 2023
@kaizencc
Copy link
Contributor

kaizencc commented Mar 2, 2023

Hi @clementrey-dev! Sorry about that, you're almost certainly correct that the custom prefix is the problem here. In cdk-pipelines-github, we use a prop called assetHashMap and the keys of the map are the assetId prior to uploading. We then try to match the asset again using the ID found in the template.

const hash = path.parse(template.split('/').pop() ?? '').name;

I think the solution here is to take into account the custom prefix of an asset before we send it into assetHashMap. We do that here:

this.assetHashMap[assetId] = jobId;

I can't think of any workaround here. We should fix this in code. That being said, this repo does not get the same maintenance as aws/aws-cdk, and you're mostly at the whim of my availability to get bug fixes in. If this is especially bothersome and you have some extra time, feel free to take a look and see if you can contribute a fix :). Would help me a lot! Otherwise, I'll have this on my radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort-small p1
Projects
None yet
Development

No branches or pull requests

2 participants