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

Unable to get example to work #4

Closed
depak-0302 opened this issue May 23, 2022 · 8 comments
Closed

Unable to get example to work #4

depak-0302 opened this issue May 23, 2022 · 8 comments
Assignees

Comments

@depak-0302
Copy link

I'm trying to get simple example to upload data to s3 bucket but it is not working. It does get any error message.

import http from "k6/http";
import { check } from "k6";
import { AWSConfig, S3Client } from "https://jslib.k6.io/aws/0.3.0/s3.js";

const awsConfig = new AWSConfig(
  __ENV.AWS_REGION,
  __ENV.AWS_ACCESS_KEY_ID,
  __ENV.AWS_SECRET_ACCESS_KEY
);

const s3 = new S3Client(awsConfig);

export default function () {
  let res = http.get("https://test-api.k6.io");
  check(res, { "is status 200": (r) => r.status === 200 });
}

export function handleSummary(data) {
  s3.putObject("myBucket", "myResultsKey", JSON.stringify(data));
}

When I run the above, output is as follows:

`LATLmacJ5QTMD6R:examples (main *+)$ k6 run s3_test.js

      /\      |‾‾| /‾‾/   /‾‾/   
 /\  /  \     |  |/  /   /  /    
/  \/    \    |     (   /   ‾‾\  

/ \ | |\ \ | (‾) |
/ __________ \ |__| _\ ____/ .io

execution: local
script: s3_test.js
output: -

scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
* default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

running (00m00.1s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs 00m00.1s/10m0s 1/1 iters, 1 per VU
LATLmacJ5QTMD6R:examples (main *+)$ `

@mstoykov
Copy link
Contributor

Hi @depak-0302,

It does get any error message.

do you mean it doesn't ?
From the looks of it - it works, otherwise an error would've been printed.

Can you please double check that there isn't an object uploaded to the configured S3 bucket?

@depak-0302
Copy link
Author

depak-0302 commented May 25, 2022 via email

@mstoykov
Copy link
Contributor

@depak-0302 can you run with --http-debug=full and see what the requests are, potentially copypasting the result here after some sanytization as it will likely include some sensitive information about your AWS account.

@oleiade
Copy link
Member

oleiade commented Jun 10, 2022

Hi @depak-0302,

Sorry to hear you're experiencing issues with uploading files to S3 buckets. Did you manage to solve your issue already?

@oleiade oleiade self-assigned this Jun 10, 2022
@depak-0302
Copy link
Author

depak-0302 commented Jun 10, 2022 via email

@oleiade
Copy link
Member

oleiade commented Jun 13, 2022

Glad to read you've found a solution to your issue.

I don't think we'll be able to do more potential bug hunting without more input from your side, so I'll close for now. Please don't hesitate to reopen if you ever find the time to provide us more context, as requested before 👍🏻

@oleiade oleiade closed this as completed Jun 13, 2022
@depak-0302
Copy link
Author

depak-0302 commented Oct 11, 2022 via email

@oleiade
Copy link
Member

oleiade commented Oct 11, 2022

Hi @depak-0302 👋🏻

Thanks for coming back to us. I see you are using an older version of k6, can you please confirm which version of the AWS jslib you're using? We've addressed some existing issues with S3 and Authentication in more recent releases, the latest being v0.6.0, and I just want to confirm that you're still experiencing this issue with the latest version.

@oleiade oleiade reopened this Oct 11, 2022
@oleiade oleiade closed this as completed Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants