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

Cdk Crash on synth of cloudwatch dashboard #7977

Closed
DamirAinullin opened this issue May 14, 2020 · 3 comments · Fixed by aws/jsii#1718
Closed

Cdk Crash on synth of cloudwatch dashboard #7977

DamirAinullin opened this issue May 14, 2020 · 3 comments · Fixed by aws/jsii#1718
Assignees
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/medium Medium work item – several days of effort in-progress This issue is being actively worked on. jsii This issue originates in jsii, or this feature must be implemented in jsii. language/dotnet Related to .NET bindings p1

Comments

@DamirAinullin
Copy link

I try to use CDK to create AWS monitoring dasboard and crash on running cdk synth command

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

PS C:\Source\hello-cdk> cdk synth
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-w2sbmt\node_modules\@aws-cdk\core\lib\lazy.js:30:44)
  at new LazyString (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\lazy.js:46:9)
  at Function.stringValue (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\lazy.js:13:39)
  at new Dashboard (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\aws-cloudwatch\lib\dashboard.js:40:40)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7853:49
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at Kernel._create (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7853:26)
  at Kernel.create (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7600:21)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\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-w2sbmt\node_modules\@aws-cdk\core\lib\private\intrinsic.js:20:44)
  at new PostResolveToken (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\util.js:72:9)
  at Object.ignoreEmpty (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\util.js:32:12)
  at CfnDashboard._toCloudFormation (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\cfn-resource.js:214:44)
  at C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:98:74
  at Object.findTokens (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\resolve.js:126:13)
  at findAllReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:98:38)
  at Object.resolveReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:21:19)
  at Object.prepareApp (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\prepare-app.js:35:16)
  at App.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\app.js:81:23)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8027:41)
  at App.onPrepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\construct-compat.js:71:14)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8027:41)
  at Node.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\constructs\lib\construct.js:365:20)
  at Node.synthesize (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\constructs\lib\construct.js:323:14)
  at Function.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\construct-compat.js:170:26)
  at App.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\app.js:72:59)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\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-w2sbmt\node_modules\@aws-cdk\core\lib\private\intrinsic.js:20:44)
  at new PostResolveToken (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\util.js:72:9)
  at CfnDashboard._toCloudFormation (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\cfn-resource.js:212:39)
  at C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:98:74
  at Object.findTokens (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\resolve.js:126:13)
  at findAllReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:98:38)
  at Object.resolveReferences (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\refs.js:21:19)
  at Object.prepareApp (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\private\prepare-app.js:35:16)
  at App.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\app.js:81:23)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8027:41)
  at App.onPrepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\construct-compat.js:71:14)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.completeCallback (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7361:25)
  at KernelHost.callbackHandler (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7342:33)
  at App.value (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8027:41)
  at Node.prepare (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\constructs\lib\construct.js:365:20)
  at Node.synthesize (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\constructs\lib\construct.js:323:14)
  at Function.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\construct-compat.js:170:26)
  at App.synth (C:\Users\DAINUL~1\AppData\Local\Temp\jsii-kernel-w2sbmt\node_modules\@aws-cdk\core\lib\app.js:72:59)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:51
  at Kernel._wrapSandboxCode (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8313:20)
  at C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7680:25
  at Kernel._ensureSync (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:8289:20)
  at Kernel.invoke (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7679:26)
  at KernelHost.processRequest (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7388:28)
  at KernelHost.run (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\jsii-runtime.js:7328:14)
  at Immediate._onImmediate (C:\Users\dainullin\AppData\Local\Temp\2hovqusm.sgk\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 HelloCdk.Program.Main(String[] args) in C:\Source\hello-cdk\src\HelloCdk\Program.cs:line 14

Environment

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

Other

It is related to these problems:
#5735
#6746


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 May 14, 2020
@SomayaB SomayaB added @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch package/tools Related to AWS CDK Tools or CLI jsii This issue originates in jsii, or this feature must be implemented in jsii. language/dotnet Related to .NET bindings and removed @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch labels May 18, 2020
@shivlaks shivlaks assigned rix0rrr and unassigned shivlaks May 26, 2020
@shivlaks shivlaks added @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch and removed package/tools Related to AWS CDK Tools or CLI labels May 26, 2020
@shivlaks
Copy link
Contributor

assigning this one to @rix0rrr as he has the context on the linked tickets - might be a jsii issue

@rix0rrr
Copy link
Contributor

rix0rrr commented May 26, 2020

This should go directly to the jsii team.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label May 27, 2020
@RomainMuller
Copy link
Contributor

RomainMuller commented Jun 8, 2020

Found the cause of this issue, definitely a jsii bug (I have a fix but I'm trying to qualify the bug more cleanly so I can have a nice regression test for this condition).

RomainMuller added a commit to aws/jsii that referenced this issue Jun 8, 2020
When obtained through an untyped way (e.g: as part of an opaque object
for example), instances of `AnonymousObject` could not be cast back to
their Kernel form, because the converter lacked a code path to handle
this type. Instead, it insisted on trying to infer a "better" run-time
type for it.

This adds the necessary code path to handle this condition and properly
return the reverse conversion.

Fixes aws/aws-cdk#7977
RomainMuller added a commit to aws/jsii that referenced this issue Jun 8, 2020
When obtained through an untyped way (e.g: as part of an opaque object
for example), instances of `AnonymousObject` could not be cast back to
their Kernel form, because the converter lacked a code path to handle
this type. Instead, it insisted on trying to infer a "better" run-time
type for it.

This adds the necessary code path to handle this condition and properly
return the reverse conversion.

Fixes aws/aws-cdk#7977
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Jun 25, 2020
@RomainMuller RomainMuller added the effort/medium Medium work item – several days of effort label Aug 11, 2020
RomainMuller added a commit to aws/jsii that referenced this issue Aug 11, 2020
…t'" (#1718)

When obtained through an untyped way (e.g: as part of an opaque object
for example), instances of `AnonymousObject` could not be cast back to
their Kernel form, because the converter lacked a code path to handle
this type. Instead, it insisted on trying to infer a "better" run-time
type for it.

This adds the necessary code path to handle this condition and properly
return the reverse conversion.

Fixes aws/aws-cdk#7977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/medium Medium work item – several days of effort in-progress This issue is being actively worked on. jsii This issue originates in jsii, or this feature must be implemented in jsii. language/dotnet Related to .NET bindings p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants