Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
574 views
in Technique[技术] by (71.8m points)

amazon s3 - aws-sdk s3 not working to migrate to gov cloud s3 from commercial

I have my code here. If I comment out line 373 and run my program with a commercial bucket and prefix on aws s3, I can get a count of the objects and size printed out no problem for my commercial bucket.

If I switch it and comment out lines 359-364 and uncomment out lines 366-371, and use a bucket and prefix on aws s3 gov cloud, I get a count of the objects and size no problem for my gov cloud bucket.

Showing my credentials are correct for both gov and commercial accounts in the S3.

However, when I reverse all my changes and try to use my function copyKeysFromCommToGov() on line 373, it creates the temp folders, downloads the files successfully, I see my consoles for lines 66 and 67 come through no problem but as soon as line 69 is started I get this error for every object that I try uploading:

{ InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
    at Request.extractError (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibservicess3.js:700:35)
    at Request.callListeners (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibsequential_executor.js:106:20)
    at Request.emit (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibsequential_executor.js:78:10)
    at Request.emit (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklib
equest.js:688:14)
    at Request.transition (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklib
equest.js:22:10)
    at AcceptorStateMachine.runTo (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibstate_machine.js:14:12)
    at F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibstate_machine.js:26:10
    at Request.<anonymous> (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklib
equest.js:38:9)
    at Request.<anonymous> (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklib
equest.js:690:12)
    at Request.callListeners (F:
odeCodeawsPrefixTransfer
ode_modulesaws-sdklibsequential_executor.js:116:18)
  message:
   'The AWS Access Key Id you provided does not exist in our records.',
  code: 'InvalidAccessKeyId',
  region: null,
  time: 2020-12-31T22:08:53.959Z,
  requestId: 'D374FE6BA01CD6F5',
  extendedRequestId:
   'd+ER9TluMtWwcnkaS3+3gwzWvwYowpRdZG8AD1D8grtPQszEYge+DoyraMEIsNGiaW+PFKUtJPM=',
  cfId: undefined,
  statusCode: 403,
  retryable: false,
  retryDelay: 48.11017268760332 }

I verified that both work when used separately by listing out the objects in owned buckets in the respective aws partitions. Is there something I am missing when using two different new aws.S3() constructors on lines 23 and 24 in my project to keep them separate?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...