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

S3Control.createJob - attempts to throw exception, but results in a deserializer error #1832

Closed
ffxsam opened this issue Dec 23, 2020 · 3 comments
Assignees
Labels
bug This issue is a bug.

Comments

@ffxsam
Copy link

ffxsam commented Dec 23, 2020

Describe the bug
Calling S3Control.createJob() results in an internal error (see below).

SDK version number
3.0.0

Is the issue in the browser/Node.js/ReactNative?
Node.js

Details of the browser/Node.js/ReactNative version
v12.18.3

To Reproduce (observed behavior)

  const data = await s3Control.createJob({
    AccountId: process.env.ACCOUNT_ID,
    ConfirmationRequired: false,
    Manifest: {
      Location: {
        ETag: manifest.eTag,
        ObjectArn: `arn:aws:s3:::${manifest.bucket}/${manifest.key}`,
      },
      Spec: {
        Format: 'S3BatchOperations_CSV_20180820',
        Fields: ['Bucket', 'Key'],
      },
    },
    Operation: {
      LambdaInvoke: {
        FunctionArn: process.env.BATCH_FUNC_ARN,
      },
    },
    Priority: 1,
    Report: {
      Bucket: manifest.bucket,
      Enabled: true,
      Prefix: 'reports/',
      ReportScope: 'AllTasks',
      Format: 'Report_CSV_20180820',
    },
    RoleArn: process.env.BATCH_ROLE_ARN,
  });

Expected behavior
If I'm doing something wrong, the error should clearly state that. However, it looks like there's an internal mistake in the library that's throwing an error.

Additional context

{
    "errorType": "TypeError",
    "errorMessage": "Cannot read property 'Code' of undefined",
    "$metadata": {
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "stack": [
        "TypeError: Cannot read property 'Code' of undefined",
        "    at loadRestXmlErrorCode (/var/task/node_modules/@aws-sdk/client-s3-control/protocols/Aws_restXml.ts:6788:18)",
        "    at deserializeAws_restXmlCreateJobCommandError (/var/task/node_modules/@aws-sdk/client-s3-control/protocols/Aws_restXml.ts:2061:15)",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)",
        "    at /var/task/node_modules/@aws-sdk/middleware-serde/src/deserializerMiddleware.ts:23:18",
        "    at /var/task/node_modules/@aws-sdk/middleware-signing/src/middleware.ts:26:22",
        "    at StandardRetryStrategy.retry (/var/task/node_modules/@aws-sdk/middleware-retry/src/defaultStrategy.ts:118:38)",
        "    at data (/var/task/node_modules/@aws-sdk/middleware-logger/src/loggerMiddleware.ts:21:20)",
        "    at Runtime.n [as handler] (/var/task/src/lambda/webpack:/v2-migrate-user/src/lambda/start-audio-file-migration.ts:11:9)"
    ]
}
@ffxsam ffxsam added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 23, 2020
@AllanZhengYP AllanZhengYP changed the title S3Control.createJob - attempts to throw error, but results in an error S3Control.createJob - attempts to throw exception, but results in a deserializer error Jan 5, 2021
@AllanZhengYP
Copy link
Contributor

Hi @ffxsam

Thank you for reporting this. The root cause of the problem is that the Error is not defined here. We can potentially use optional chaining to make it not throwing when Error is not defined. We also need to investigate why it is not defined because it breaks the contract.

@AllanZhengYP AllanZhengYP removed the needs-triage This issue or PR still needs to be triaged. label Jan 5, 2021
@AllanZhengYP AllanZhengYP self-assigned this Jan 5, 2021
@apburgess
Copy link

apburgess commented Dec 12, 2021

Any movement on this? It's been nearly a year.

I think this issue might be the same issue as #2861

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

5 participants