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

Presigned URL is giving an error on dev environment - AnonymousRequestError: Presigned GET url cannot be generated for anonymous requests #1347

Open
nikhilguptagl opened this issue Sep 19, 2024 · 1 comment

Comments

@nikhilguptagl
Copy link

nikhilguptagl commented Sep 19, 2024

NOTE

If this case is urgent, please subscribe to Subnet so that our 24/7 support team may help you faster.

I am using presigned URL with this chunk of code -

try {
      const dataStream = await MinIO.presignedGetObject(
        bucketName,
        objectName,
        24 * 60 * 60
      );
      const response = await axios.get(dataStream, { responseType: "stream" });
      let xmlContent = "";
      for await (const chunk of response.data) {
        xmlContent += chunk.toString();
      }
      res.send({ fileObject: btoa(xmlContent) });
    } catch (error) {
      res.send({ message: `${ERRORMESSAGE_3} ${error}` });
      return null;
    }

On local machine when connected to minio in dev environment, it is working fine, but when application gets deployed to dev environment - it throws an error while fetching the assets from minio - AnonymousRequestError: Presigned GET url cannot be generated for anonymous requests

Minio config -
endPoint: 'endpoint.name',
port: 9000,
useSSL: false,
accessKey: 'accesskey',
secretKey: 'secretKey',

@harshavardhana harshavardhana transferred this issue from minio/minio Sep 19, 2024
@prakashsvmx
Copy link
Member

Please check mc admin trace -v ALIAS for both the cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants