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

Incorrect template for cloudwatch dashboard #6746

Closed
DamirAinullin opened this issue Mar 16, 2020 · 12 comments · Fixed by aws/jsii#1347
Closed

Incorrect template for cloudwatch dashboard #6746

DamirAinullin opened this issue Mar 16, 2020 · 12 comments · Fixed by aws/jsii#1347
Assignees
Labels
bug This issue is a bug. jsii This issue originates in jsii, or this feature must be implemented in jsii. p1

Comments

@DamirAinullin
Copy link

DamirAinullin commented Mar 16, 2020

I try to use CDK to create AWS monitoring dasboard and get problem with incorrect template.

Reproduction Steps

        internal DashboardStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
        {
            var dashboard = new Dashboard(this, "MonitoringDashboard", new DashboardProps
            {
                DashboardName = "MonitoringDashboard"
            });
 
            dashboard.AddWidgets(BuildWidget("dev", "Invocations", "Sum"));
        }

        private GraphWidget BuildWidget(string env, string metricName, string statistic)
        {
            IMetric metric = new Metric(new MetricProps
            {
                Namespace = "AWS/Lambda",
                Region = Region,
                Account = Account,
                Label = "functionName",
                MetricName = metricName,
                Dimensions = new Dictionary<string, object>(1) { { "FunctionName", "functionName" } },
                Statistic = statistic
            });
            var graphWidgetProps = new GraphWidgetProps
            {
                Title = metricName,
                Region = Region,
                Left = new [] { metric }
            };
            return new GraphWidget(graphWidgetProps);
        }

Error Log

The problem starts with the metrics attribute.
When I run "cdk synth" I see incorrect template with such part for metrics:

- '","metrics":[{"value":["AWS/Lambda","Invocations","FunctionName","functionName",{"label":"functionName","accountId":"'
            - Ref: AWS::AccountId
            - '","region":"'
            - Ref: AWS::Region
            - '","stat":"Sum"}],"creationStack":["new DropEmptyObjectAtTheEndOfAnArray (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\private\\drop-empty-object-at-the-end-of-an-array-token.js:14:34)","C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\private\\rendering.js:27:38","Array.map (<anonymous>)","Object.allMetricsGraphJson (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\private\\rendering.js:27:25)","GraphWidget.toJson (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\graph.js:46:37)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:51","Kernel._wrapSandboxCode (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8298:20)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:25","Kernel._ensureSync (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8274:20)","Kernel.invoke (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7664:26)","KernelHost.processRequest (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7372:28)","KernelHost.completeCallback (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7345:25)","KernelHost.callbackHandler (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7326:33)","GraphWidget.value (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8012:41)","Column.toJson (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\layout.js:69:32)","Object.produce (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\aws-cloudwatch\\lib\\dashboard.js:38:41)","LazyString.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\lazy.js:50:30)","DefaultTokenResolver.resolveToken (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\resolvable.js:39:30)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:94:33)","Object.resolve [as mapToken] (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","TokenizedStringFragments.mapTokens (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\string-fragments.js:56:43)","DefaultTokenResolver.resolveString (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\resolvable.js:58:26)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:61:37)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:111:43)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","DefaultTokenResolver.resolveToken (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\resolvable.js:41:32)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:94:33)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:111:43)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","DefaultTokenResolver.resolveToken (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\resolvable.js:41:32)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:94:33)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:111:43)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:28:33)","Object.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\private\\resolve.js:111:43)","Stack.resolve (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\stack.js:141:26)","C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\stack.js:658:50","Array.map (<anonymous>)","Stack._toCloudFormation (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\stack.js:658:36)","Stack.synthesize (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\stack.js:596:42)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:51","Kernel._wrapSandboxCode (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8298:20)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:25","Kernel._ensureSync (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8274:20)","Kernel.invoke (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7664:26)","KernelHost.processRequest (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7372:28)","KernelHost.completeCallback (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7345:25)","KernelHost.callbackHandler (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7326:33)","Stack.value (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8012:41)","Function.synth (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\construct.js:65:27)","App.synth (C:\\Users\\DAINUL~1\\AppData\\Local\\Temp\\jsii-kernel-Tuw0UU\\node_modules\\@aws-cdk\\core\\lib\\app.js:71:52)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:51","Kernel._wrapSandboxCode (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8298:20)","C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7665:25","Kernel._ensureSync (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:8274:20)","Kernel.invoke (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7664:26)","KernelHost.processRequest (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7372:28)","KernelHost.run (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7312:14)","Immediate._onImmediate (C:\\Users\\dainullin\\AppData\\Local\\Temp\\vaal4m0b.3pw\\jsii-runtime.js:7315:37)","processImmediate (internal/timers.js:456:21)"]}],"yAxis":{}}}]}'

Environment

  • **CLI Version :1.28.0
  • **Framework Version:1.28.0
  • **OS :Windows
  • **Language :C#

Other

I suppose it somehow related to this problem:
#5735


This is 🐛 Bug Report

@DamirAinullin DamirAinullin added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 16, 2020
@SomayaB SomayaB added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Mar 16, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 17, 2020

This looks very weird indeed. Can you provide a minimal reproducing sample?

@DamirAinullin
Copy link
Author

@rix0rrr I have already added the code which can lead to the problem. You can put it into sample-app and then run "cdk synth".

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 18, 2020

Yes, you are right, sorry. I thought the sample was incomplete because Account and Region came out of nowhere, but obviously they're members of the Stack class. Not used to implicit this. anymore :).

Investigating.

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 18, 2020

The issue seems to be that we are trying to serialize a Token (Lazy.anyValue() or other) in a position that is typed as any, and JSII doesn't like that. It should be serializing it as a reference, but it is instead serializing it as a struct:

// The following can never work
[@jsii/kernel] fromSandbox {
  type: 'metric',
  width: 6,
  height: 6,
  x: 0,
  y: 0,
  properties: {
    view: 'timeSeries',
    title: 'Invocations',
    region: '${Token[AWS::Region.4]}',
    stacked: undefined,
    metrics: [ [DropEmptyObjectAtTheEndOfAnArray] ],  // <-- this thing will go wrong
    annotations: undefined,
    yAxis: { left: undefined, right: undefined }
  }
} [{"serializationClass":"Any","typeRef":{"type":{"primitive":"any"}}}]

// When it recurses down to that object
[@jsii/kernel] fromSandbox DropEmptyObjectAtTheEndOfAnArray {
  value: [
    'AWS/Lambda',
    'Invocations',
    'FunctionName',
    'functionName',
    { label: 'functionName', stat: 'Sum' }
  ],
  creationStack: [
    // ...
    ]
} [{"serializationClass":"Any","typeRef":{"type":{"primitive":"any"}}}

The rest of the logging is not very useful but it comes down to the serializer serializing the individual fields of the token (because it's treating the token as a data type).

@rix0rrr rix0rrr added jsii This issue originates in jsii, or this feature must be implemented in jsii. and removed @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch labels Mar 18, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 18, 2020

BTW confirmed that the same code works fine in TypeScript.

@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 18, 2020

A "fix" would be to serialize by reference if any of the fields are functions...?

Or if the object has a prototype chain?

@RomainMuller
Copy link
Contributor

Somehow, it appears that none of the methods of the DropEmptyObjectAtTheEndOfAnArray type (which is a private type of @aws-cdk/aws-cloudwatch not jsii-exported) come out in the enumeration at @jsii/kernel/lib/serialization.ts#L486 so they don't trigger the guard at (which would not make the problem nicer) @jsii/kernel/lib/serialization.ts#L441-L443.

A "quick fix" (CDK-side) is to introduce some jsii-exported base class and have DropEmptyObjectAtTheEndOfAnArray extend that.

Longer term - I like your idea of checking for a prototype chain and if there is one. We'll have to move carefully to make sure this does not cause any regression... So it'll probably take a little longer...

@RomainMuller RomainMuller added p1 and removed needs-triage This issue or PR still needs to be triaged. labels Mar 18, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 18, 2020

Prototype chain is not good enough though, it would miss objects defined like this:

return {
  value: 'hello',
  alsoFunction() { /* do something */ },
};

return {
  value: 'hello',
  alsoFunction: () => { /* do something */ },
};

I think the only thing to do is add a check just before https://github.com/aws/jsii/blob/a2da0bfce356c2332232808d4d6eaccaf7c6d4ad/packages/%40jsii/kernel/lib/serialization.ts#L486 where we iterate the object for functions, and not just its own properties but including its prototype chain.

RomainMuller added a commit to aws/jsii that referenced this issue Mar 18, 2020
When a "private" type (aka a class that is not visible in the `.jsii`
assembly) is passed from JS to Host through an `any`-typed entity, the
value was serialized by-value, passing only the instance's properties,
and omitting any methods.

This changes the behavior of the `SerializationClass.Any` serializer,
so that when an anonymous object is encountered, if it has a dynamic
getter, setter or any method (including a constructor), it is passed
by-reference instead of by-value.

Fixes aws/aws-cdk#6746
@RomainMuller
Copy link
Contributor

RomainMuller commented Mar 18, 2020

I have a candidate fix in aws/jsii#1347. I need to make sure it does not break some of the existing APIs that return any stuff and that must have a by-value treatment to be useful in other languages. This should (hopefully) not take too long.

It works by looking up the prototype chain for methods or dynamic property accessors (we cannot guarantee those are stable, so they get by-ref treatment, too -- it's safer).

RomainMuller added a commit to aws/jsii that referenced this issue Mar 18, 2020
When a "private" type (aka a class that is not visible in the `.jsii`
assembly) is passed from JS to Host through an `any`-typed entity, the
value was serialized by-value, passing only the instance's properties,
and omitting any methods.

This changes the behavior of the `SerializationClass.Any` serializer,
so that when an anonymous object is encountered, if it has a dynamic
getter, setter or any method (including a constructor), it is passed
by-reference instead of by-value.

Fixes aws/aws-cdk#6746
@DamirAinullin
Copy link
Author

@RomainMuller Do you have any information which version of CDK will contain the fix for this problem? And when? I tried on 1.31.0 and the problem is reproduced.

@MrArnoldPalmer
Copy link
Contributor

@DamirAinullin the fix landed in 1.2.0 which we are working on upgrading CDK to use. This should go out in the next release.

@DamirAinullin
Copy link
Author

DamirAinullin commented Apr 23, 2020

@MrArnoldPalmer Try to use CDK version 1.34.1. And get app crash during cdk deploy with the following exception:

Unhandled exception. Amazon.JSII.Runtime.JsiiException: Amazon.JSII.Runtime.JsiiException: Amazon.JSII.Runtime.JsiiException: Resolution error: Resolution error: Resolution error: System.ArgumentException: Could not infer JSII type for .NET type 'AnonymousObject' (Parame
ter 'type')
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.InferType(IReferenceMap referenceMap, Type type)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.InferType(IReferenceMap referenceMap, Object value)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.ConvertAny(Type type, IReferenceMap referenceMap, Object value)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.TryConvertPrimitive(Type type, IReferenceMap referenceMap, Object value, Boolean isOptional, PrimitiveType primitiveType, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.TryConvert(IOptionalValue optionalValue, Type type, IReferenceMap referenceMap, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.TryConvert(TypeReference typeReference, Type type, IReferenceMap referenceMap, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertCollectionElement(Object element, IReferenceMap referenceMap, TypeReference elementType, Object& convertedElement)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertArray(IReferenceMap referenceMap, TypeReference elementType, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertCollectionElement(Object element, IReferenceMap referenceMap, TypeReference elementType, Object& convertedElement)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertMap(IReferenceMap referenceMap, TypeReference elementType, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertCollectionElement(Object element, IReferenceMap referenceMap, TypeReference elementType, Object& convertedElement)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertMap(IReferenceMap referenceMap, TypeReference elementType, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertCollectionElement(Object element, IReferenceMap referenceMap, TypeReference elementType, Object& convertedElement)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvertArray(IReferenceMap referenceMap, TypeReference elementType, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.TryConvertCollection(IReferenceMap referenceMap, Object value, Boolean isOptional, CollectionTypeReference collectionType, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.ValueConverter.TryConvert(IOptionalValue optionalValue, Type type, IReferenceMap referenceMap, Object value, Object& result)
   at Amazon.JSII.Runtime.Services.Converters.FrameworkToJsiiConverter.TryConvert(IOptionalValue optionalValue, IReferenceMap referenceMap, Object value, Object& result)
   at Amazon.JSII.Runtime.CallbackExtensions.InvokeCallback(Callback callback, IReferenceMap referenceMap, IFrameworkToJsiiConverter converter, String& error).
Object creation stack:
  at new LazyBase (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\lazy.js:30:44)
  at new LazyString (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\lazy.js:46:9)
  at Function.stringValue (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\lazy.js:13:39)
  at new Dashboard (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\aws-cloudwatch\lib\dashboard.js:40:40)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7853:49
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at Kernel._create (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7853:26)
  at Kernel.create (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7600:21)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7331:37)
  at processImmediate (internal/timers.js:456:21).
Object creation stack:
  at new Intrinsic (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\intrinsic.js:20:44)
  at new PostResolveToken (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\util.js:72:9)
  at Object.ignoreEmpty (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\util.js:32:12)
  at CfnDashboard._toCloudFormation (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\cfn-resource.js:214:44)
  at C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:98:74
  at Object.findTokens (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\resolve.js:126:13)
  at findAllReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:98:38)
  at Object.resolveReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:21:19)
  at Object.prepareApp (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\prepare-app.js:24:16)
  at App.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\app.js:81:23)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8027:41)
  at App.onPrepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\construct-compat.js:71:14)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8027:41)
  at Node.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\constructs\lib\construct.js:365:20)
  at Node.synthesize (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\constructs\lib\construct.js:323:14)
  at Function.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\construct-compat.js:170:26)
  at App.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\app.js:72:59)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7331:37)
  at processImmediate (internal/timers.js:456:21).
Object creation stack:
  at new Intrinsic (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\intrinsic.js:20:44)
  at new PostResolveToken (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\util.js:72:9)
  at CfnDashboard._toCloudFormation (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\cfn-resource.js:212:39)
  at C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:98:74
  at Object.findTokens (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\resolve.js:126:13)
  at findAllReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:98:38)
  at Object.resolveReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\refs.js:21:19)
  at Object.prepareApp (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\private\prepare-app.js:24:16)
  at App.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\app.js:81:23)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8027:41)
  at App.onPrepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\construct-compat.js:71:14)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8027:41)
  at Node.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\constructs\lib\construct.js:365:20)
  at Node.synthesize (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\constructs\lib\construct.js:323:14)
  at Function.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\construct-compat.js:170:26)
  at App.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-lXUBkC\node_modules\@aws-cdk\core\lib\app.js:72:59)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\x5wiu4ea.dlw\jsii-runtime.js:7331:37)
  at processImmediate (internal/timers.js:456:21)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.Invoke(InvokeRequest request)
   at Amazon.JSII.Runtime.Services.Client.Invoke(ObjectReference objectReference, String method, Object[] arguments)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<>c__DisplayClass17_0`1.<InvokeInstanceMethod>b__1(IClient client, Object[] args)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<InvokeMethodCore>g__GetResult|18_0[T](<>c__DisplayClass18_0`1& )
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeMethodCore[T](JsiiMethodAttribute methodAttribute, Object[] arguments, Func`3 beginFunc, Func`3 invokeFunc)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeInstanceMethod[T](Type[] parameterTypes, Object[] arguments, String methodName)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeInstanceVoidMethod(Type[] parameterTypes, Object[] arguments, String methodName)
   at Amazon.CDK.App.Prepare()
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.Invoke(InvokeRequest request)
   at Amazon.JSII.Runtime.Services.Client.Invoke(ObjectReference objectReference, String method, Object[] arguments)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<>c__DisplayClass17_0`1.<InvokeInstanceMethod>b__1(IClient client, Object[] args)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<InvokeMethodCore>g__GetResult|18_0[T](<>c__DisplayClass18_0`1& )
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeMethodCore[T](JsiiMethodAttribute methodAttribute, Object[] arguments, Func`3 beginFunc, Func`3 invokeFunc)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeInstanceMethod[T](Type[] parameterTypes, Object[] arguments, String methodName)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeInstanceVoidMethod(Type[] parameterTypes, Object[] arguments, String methodName)
   at Amazon.CDK.Construct.OnPrepare()
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Send[TRequest,TResponse](TRequest requestObject)
   at Amazon.JSII.Runtime.Services.Client.Invoke(InvokeRequest request)
   at Amazon.JSII.Runtime.Services.Client.Invoke(ObjectReference objectReference, String method, Object[] arguments)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<>c__DisplayClass17_0`1.<InvokeInstanceMethod>b__1(IClient client, Object[] args)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.<InvokeMethodCore>g__GetResult|18_0[T](<>c__DisplayClass18_0`1& )
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeMethodCore[T](JsiiMethodAttribute methodAttribute, Object[] arguments, Func`3 beginFunc, Func`3 invokeFunc)
   at Amazon.JSII.Runtime.Deputy.DeputyBase.InvokeInstanceMethod[T](Type[] parameterTypes, Object[] arguments, String methodName)
   at Amazon.CDK.App.Synth()
   at Dashboards.Program.Main(String[] args) in 
src\Dashboards\Program.cs:line 12
Subprocess exited with error 3762504530

Can you look at it please? The reproduction code is the same as at the begining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. jsii This issue originates in jsii, or this feature must be implemented in jsii. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants