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

[BUG] OpenSearch Reporting CLI Lambda always prepends "tmp" to email attachments #43

Closed
aaronbrighton opened this issue May 5, 2023 · 2 comments · Fixed by #60
Closed
Labels
bug Something isn't working

Comments

@aaronbrighton
Copy link

What is the bug?

When using the OpenSearch Reporting CLI Lambda function, the filename for email attachments always has "tmp" prepended to the filename.

How can one reproduce the bug?

Follow the instructions here (https://opensearch.org/docs/latest/dashboards/reporting-cli/rep-cli-lambda/).

What is the expected behavior?

Attachment filename should look something like this: opensearch-report-2023-03-31T12-00-51.433Z instead of tmpopensearch-report-2023-03-31T12-00-51.433Z.

What is your host/environment?

N/A

Do you have any screenshots?

See description for observed behavior.

Do you have any additional context?

It appears the following code which defines where to temporarily save the file is being propagated to the email function that attaches the file to the email and incorporating the folder name "tmp" in the value:

options.filename = '/tmp/' + options.filename;

filename: file,

Potentially easy fix by wrapping the value on line 111 above with path.basename()?

@aaronbrighton aaronbrighton added bug Something isn't working untriaged labels May 5, 2023
@joshuali925
Copy link
Member

i feel this was a workaround for current directory not writable but user can write to /tmp dir? @rupal-bq

@rupal-bq
Copy link
Contributor

i feel this was a workaround for current directory not writable but user can write to /tmp dir? @rupal-bq

Yes. In Lambda we can write only to the /tmp.

https://repost.aws/questions/QUoCCNNS59RryAKeEBezXFcg/how-to-work-around-directory-permissions-in-aws-lambda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants