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

aws-ecs-patterns: Trying to pass a Queue into QueueProcessingFargateService errors #3579

Closed
1 of 5 tasks
costleya opened this issue Aug 8, 2019 · 5 comments
Closed
1 of 5 tasks
Assignees
Labels
bug This issue is a bug. language/dotnet Related to .NET bindings p1

Comments

@costleya
Copy link
Contributor

costleya commented Aug 8, 2019

  • I'm submitting a ...
    • πŸͺ² bug report
    • πŸš€ feature request
    • πŸ“š construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.

Using the .NET CDK,

var inputQueue = new Queue(this, "InputQueue", null);
var inputProcessor = new QueueProcessingFargateService(this, "InputProcessor", new QueueProcessingFargateServiceProps
            {
                Cluster = cluster,
                Image = ContainerImage.FromAsset("./NetInfluencersProcessorOutput", null),
                Queue = inputQueue
            });

results in the following error:

Unhandled Exception: Amazon.JSII.Runtime.JsiiException: System.Reflection.TargetParameterCountException: Parameter count mismatch.
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Amazon.JSII.Runtime.CallbackExtensions.InvokeMethod(InvokeRequest request, IReferenceMap referenceMap)
   at Amazon.JSII.Runtime.CallbackExtensions.InvokeCallback(Callback callback, IReferenceMap referenceMap, IFrameworkToJsiiConverter converter, String& error)
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.TryDeserialize[TResponse](String responseJson)
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
   at NetInfluencersDemo.NetInfluencersDemoStack..ctor(Construct scope, String name, IStackProps props) in C:\Users\costleya\Work\A\B\DemoStack.c
s:line 47
   at Demo.Program.Main(String[] args) in C:\Users\costleya\Work\A\B\Program.cs:line 12
Subprocess exited with error 3762504530

Removing the Queue argument resolves the exception.

  • What is the expected behavior (or behavior of feature suggested)?
    I should be able to specify a queue construct to use.

  • What is the motivation / use case for changing the behavior or adding this feature?
    It's a bug. Documentation says this should work.

  • Please tell us about your environment:

    • CDK CLI Version: 1.3.0 (build bba9914)
    • Module Version: 1.3.0-devpreview
    • OS: Windows 10
    • Language: .NET (Not tested with Typescript)
@costleya costleya added the needs-triage This issue or PR still needs to be triaged. label Aug 8, 2019
@eladb eladb added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Aug 13, 2019
@piradeepk piradeepk changed the title Trying to pass a Queue into QueueProcessingFargateService errors aws-ecs-patterns: Trying to pass a Queue into QueueProcessingFargateService errors Aug 13, 2019
@NGL321 NGL321 added language/dotnet Related to .NET bindings bug This issue is a bug. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 14, 2019
@piradeepk
Copy link
Contributor

@eladb, @NGL321 looks like this might be related to JSII and not to the ECS construct itself. The following in typescript works:

const vpc = new ec2.Vpc(stack, 'MyVpc', { maxAzs: 2 });
const cluster = new ecs.Cluster(stack, 'Cluster', { vpc });
const queue = new Queue(stack, 'queue', {});

new ecs_patterns.QueueProcessingFargateService(stack, "FargateService", {
  cluster,
  image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, 'local-image')),
  queue,
});

@piradeepk piradeepk removed the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Aug 14, 2019
@eladb eladb unassigned eladb and NGL321 Aug 14, 2019
@RomainMuller
Copy link
Contributor

Yeah this is clearly a JSII issue. This may have been fixed in the latest jsii, we should try to reproduce again once a version of CDK ships with jsii >= 0.15.1

@SoManyHs SoManyHs added the @aws-cdk/aws-ecs-patterns Related to ecs-patterns library label Aug 19, 2019
@piradeepk piradeepk removed the @aws-cdk/aws-ecs-patterns Related to ecs-patterns library label Aug 19, 2019
@assyadh
Copy link
Contributor

assyadh commented Aug 20, 2019

Relates #2375
Relates aws/jsii#404

Same root cause, Correctly deserialize callback arguments #404

@RomainMuller
Copy link
Contributor

Might be fixed in the next CDK release!

@RomainMuller RomainMuller added the p1 label Nov 5, 2019
@RomainMuller
Copy link
Contributor

Confirmed fixed in CDK >= 1.18.0.

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. language/dotnet Related to .NET bindings p1
Projects
None yet
Development

No branches or pull requests

7 participants