Giter Site home page Giter Site logo

Comments (29)

QingWei-Li avatar QingWei-Li commented on May 17, 2024 3

@ilovefreesw https://stackoverflow.com/questions/41071208/permanentredirect-exception-aws-sdk-s3-rails-5

try this

STORE_ACCESS_KEY=[your access key]
STORE_SECRET_KEY=[your secret key]
STORE_BUCKET=ilfstesting
STORE_REGION=us-east-1
STORE_END_POINT=https://s3.us-east-1.amazonaws.com
PASSWORD=123

or try to replace all us-east-1 to us-west-2

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024 1

@ilovefreesw You are missing STORE_END_POINT

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

Please take a look at docker log.
Did you manually create the bucket?

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

I have the same error when using Exoscale S3.

Docker logs gives me:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5TypeError: Cannot read property 'byteLength' of undefined
    at Object.fromArrayBuffer (/app/node_modules/@aws-sdk/util-buffer-from/dist/cjs/index.js:6:60)
    at castSourceData (/app/node_modules/@aws-sdk/hash-node/dist/cjs/index.js:29:31)
    at Hash.update (/app/node_modules/@aws-sdk/hash-node/dist/cjs/index.js:12:26)
    at hmac (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/credentialDerivation.js:60:10)
    at Object.getSigningKey (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/credentialDerivation.js:32:29)
    at SignatureV4.getSigningKey (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js:139:39)
    at SignatureV4.signRequest (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js:98:73)
    at async /app/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:14:22
    at async StandardRetryStrategy.retry (/app/node_modules/@aws-sdk/middleware-retry/dist/cjs/defaultStrategy.js:56:46)
    at async /app/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22 {
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}

Edit; running today's latest, on a empty bucket.

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

For some reasons, I couldn't create notea bucket so I used an existing one. Logs in my case:

testo101@testo:~/Downloads$ sudo docker logs 6a
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
    at deserializeAws_restXmlGetObjectCommandError (/app/node_modules/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js:6184:41)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /app/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20
    at async /app/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:12:24
    at async StandardRetryStrategy.retry (/app/node_modules/@aws-sdk/middleware-retry/dist/cjs/defaultStrategy.js:56:46)
    at async /app/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22
    at async StoreS3.getObject (/app/.next/server/pages/index.js:2379:22)
    at async getSettings (/app/.next/server/pages/index.js:6795:44)
    at async handler (/app/.next/server/pages/index.js:2219:18)
    at async handler (/app/.next/server/pages/index.js:6896:17) {
  Code: 'PermanentRedirect',
  Endpoint: 'ilfstesting.s3-us-west-2.amazonaws.com',
  Bucket: 'ilfstesting',
  RequestId: '7193SM52DAAGZEXC',
  HostId: '3TQ0EeNQs3U5gZcjYJMZVdKO1iOQqjDrrJupOLbDaULJqU4xiD6tFT7sNPeqjtBa0XM4SXxz46M=',
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 301,
    requestId: undefined,
    extendedRequestId: '3TQ0EeNQs3U5gZcjYJMZVdKO1iOQqjDrrJupOLbDaULJqU4xiD6tFT7sNPeqjtBa0XM4SXxz46M=',
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

For some reasons, I couldn't create notea bucket so I used an existing one. Logs in my case:

testo101@testo:~/Downloads$ sudo docker logs 6a
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
    at deserializeAws_restXmlGetObjectCommandError (/app/node_modules/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js:6184:41)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /app/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20
    at async /app/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:12:24
    at async StandardRetryStrategy.retry (/app/node_modules/@aws-sdk/middleware-retry/dist/cjs/defaultStrategy.js:56:46)
    at async /app/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22
    at async StoreS3.getObject (/app/.next/server/pages/index.js:2379:22)
    at async getSettings (/app/.next/server/pages/index.js:6795:44)
    at async handler (/app/.next/server/pages/index.js:2219:18)
    at async handler (/app/.next/server/pages/index.js:6896:17) {
  Code: 'PermanentRedirect',
  Endpoint: 'ilfstesting.s3-us-west-2.amazonaws.com',
  Bucket: 'ilfstesting',
  RequestId: '7193SM52DAAGZEXC',
  HostId: '3TQ0EeNQs3U5gZcjYJMZVdKO1iOQqjDrrJupOLbDaULJqU4xiD6tFT7sNPeqjtBa0XM4SXxz46M=',
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 301,
    requestId: undefined,
    extendedRequestId: '3TQ0EeNQs3U5gZcjYJMZVdKO1iOQqjDrrJupOLbDaULJqU4xiD6tFT7sNPeqjtBa0XM4SXxz46M=',
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@sbkg0002 Please check if STORE_ACCESS_KEY or other env variable is missing.

This has a similar problem https://stackoverflow.com/questions/66731661/aws-cognito-client-sdk-v3-returns-bytelength-of-undefined-when-running-admin-d

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

@ilovefreesw You are missing STORE_END_POINT

Sorry not I am not much of a technical person. What should I set it to ? 0.0.0.0 ? and in S3 configuration, there is no STORE_END_POINT on the read me page..

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

Thanks @QingWei-Li . Using the provided Minio compose + the example .env file - which has STORE_END_POINT, I still get this error.

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@ilovefreesw Are you using MinIO or Amazon S3? If itโ€™s amazon s3, you donโ€™t need to set STORE_FORCE_PATH_STYLE=true

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

@ilovefreesw Are you using MinIO or Amazon S3? If itโ€™s amazon s3, you donโ€™t need to set STORE_FORCE_PATH_STYLE=true

Yes I am using S3. So I don't have to set STORE_END_POINT ? right? In my second attempt, I didn't use STORE_FORCE_PATH_STYLE=true and still got the same error.

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@sbkg0002 Sorry .env.example is mssing STORE_FORCE_PATH_STYLE. Are you using MinIO or Amazon S3?

I think I need to add environment variable verification..๐Ÿ˜‚

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

I'm using S3 compatible service by Exoscale.

Using this simple compose, it works:

version: '2'

services:
  minio:
    image: minio/minio
    ports:
      - '9000:9000'
    environment:
      - MINIO_ACCESS_KEY="minio"
      - MINIO_SECRET_KEY="minio123"
    entrypoint: sh
    command: -c 'mkdir -p /data/notea && /usr/bin/minio server /data'
    networks:
    - notea

  notea:
    container_name: notea
    image: cinwell/notea
    ports:
      - '3030:3000'
    environment:
      - STORE_ACCESS_KEY="minio"
      - STORE_SECRET_KEY="minio123"
      - STORE_BUCKET=notea
      - 'STORE_END_POINT=http://minio:9000'
      - STORE_FORCE_PATH_STYLE=true
      - PASSWORD=notea
    networks:
      - notea

networks:
  notea: {}

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

Also, in the log it says : Endpoint: 'ilfstesting.s3-us-west-2.amazonaws.com'
But my region is us-east-1. I am no expert but is this right or some sort of internal bug?

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@ilovefreesw Maybe your key belongs to s3-us-west-2 not us-east-1.

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

@ilovefreesw Maybe your key belongs to s3-us-west-2 not us-east-1.

No, I always use us-east-1 whenever I need S3. I have never used us-west-2. I am sure.

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

I'm using S3 compatible service by Exoscale.

How that works for you. I get error in that as well.

image

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

It doesn't ๐Ÿ˜„ I still get the Notea 500 | Internal Server Error. page.

EDIT:
@ilovefreesw Via that compose file the Notea is available on port 3030 (since 3000 is used by Grafana on my server)

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@ilovefreesw I have no idea... Maybe you can try to set STORE_END_POINT=ilfstesting.s3-us-east-1.amazonaws.com or just set STORE_REGION=us-west-2

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

I tried with and without the region (since that seems to be part of the endpoint), but no juice with this .env.

STORE_ACCESS_KEY=<somthing>
STORE_SECRET_KEY=<somthing>
STORE_BUCKET=notea
STORE_END_POINT=https://sos-de-fra-1.exo.io
STORE_REGION=de-fra-1
PASSWORD=notea
STORE_FORCE_PATH_STYLE=true

I did create the bucket upfront.

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@sbkg0002 What is the latest error log

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

@ilovefreesw I have no idea... Maybe you can try to set STORE_END_POINT=ilfstesting.s3-us-east-1.amazonaws.com or just set STORE_REGION=us-west-2

Nope... still it's not going to work :/

image

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

@sbkg0002 What is the latest error log

Really the same error:

info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5TypeError: Cannot read property 'byteLength' of undefined
    at Object.fromArrayBuffer (/app/node_modules/@aws-sdk/util-buffer-from/dist/cjs/index.js:6:60)
    at castSourceData (/app/node_modules/@aws-sdk/hash-node/dist/cjs/index.js:29:31)
    at Hash.update (/app/node_modules/@aws-sdk/hash-node/dist/cjs/index.js:12:26)
    at hmac (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/credentialDerivation.js:60:10)
    at Object.getSigningKey (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/credentialDerivation.js:32:29)
    at SignatureV4.getSigningKey (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js:139:39)
    at SignatureV4.signRequest (/app/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js:98:73)
    at async /app/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:14:22
    at async StandardRetryStrategy.retry (/app/node_modules/@aws-sdk/middleware-retry/dist/cjs/defaultStrategy.js:56:46)
    at async /app/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22 {
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}

This is with these settings:

STORE_BUCKET=notea
STORE_END_POINT=https://sos-de-fra-1.exo.io
STORE_REGION=de-fra-1
PASSWORD=notea
STORE_FORCE_PATH_STYLE=true

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@sbkg0002 maybe you don't need STORE_FORCE_PATH_STYLE

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

Lmao .. it doesn't work on Vercel either ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜ณ๐Ÿ˜ณ

image

from notea.

ilovefreesw avatar ilovefreesw commented on May 17, 2024

@ilovefreesw https://stackoverflow.com/questions/41071208/permanentredirect-exception-aws-sdk-s3-rails-5

try this

STORE_ACCESS_KEY=[your access key]
STORE_SECRET_KEY=[your secret key]
STORE_BUCKET=ilfstesting
STORE_REGION=us-east-1
STORE_END_POINT=https://s3.us-east-1.amazonaws.com
PASSWORD=123

or try to replace all us-east-1 to us-west-2

It worked by replacing us-east-1 with us-west-2

I'll try to do the same with Docker and will report back.

image

Edit: Tested on Docker and works now there as well.

Correct docker command:

sudo docker run -d \
>   --name notea \
>   -p 3000:3000 \
>   -e STORE_ACCESS_KEY=AKIxxxxxxxxxxQ \
>   -e STORE_SECRET_KEY=Svxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxm \
>   -e STORE_BUCKET=ilfstesting \
>   -e STORE_REGION=us-west-2 \
>   -e STORE_END_POINT=https://s3.us-west-2.amazonaws.com \
>   -e PASSWORD=pass@123 \
>   cinwell/notea

image

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

For some reason, this works - sorta: the login page is there, but entering the correct password doesn't do anything; even the log doesn't mention it. Entering the wrong password, gives incorrect password and gets an API_ERR_NEED_LOGIN in the logs.

docker run -it --rm   --name notea   -p 3040:3000   -e STORE_ACCESS_KEY=[...]   -e STOR
E_SECRET_KEY=[...]   -e STORE_BUCKET=notea   -e STORE_REGION=de-fra-1   -e STORE_END_PO
INT=https://sos-de-fra-1.exo.io   -e PASSWORD=pass@123  cinwell/notea

Any ideas?

from notea.

QingWei-Li avatar QingWei-Li commented on May 17, 2024

@sbkg0002 You mean can't login via http://localhost:3040? It may be a limitation of the browser.
However, you need to set COOKIE_SECURE=false if website is not https.

from notea.

sbkg0002 avatar sbkg0002 commented on May 17, 2024

COOKIE_SECURE=false

I run in on a server, but still the winner ๐Ÿ‘

from notea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.