Closed ilovefreesw closed 3 years ago
Please take a look at docker log. Did you manually create the bucket?
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.
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
}
}
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
}
}
@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
@ilovefreesw You are missing STORE_END_POINT
@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..
Thanks @QingWei-Li . Using the provided Minio compose + the example .env
file - which has STORE_END_POINT
, I still get this error.
@ilovefreesw Are you using MinIO or Amazon S3? If itβs amazon s3, you donβt need to set STORE_FORCE_PATH_STYLE=true
@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.
@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..π
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: {}
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?
@ilovefreesw Maybe your key belongs to s3-us-west-2
not us-east-1
.
@ilovefreesw Maybe your key belongs to
s3-us-west-2
notus-east-1
.
No, I always use us-east-1
whenever I need S3. I have never used us-west-2
. I am sure.
I'm using S3 compatible service by Exoscale.
How that works for you. I get error in that as well.
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)
@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
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.
@sbkg0002 What is the latest error log
@ilovefreesw I have no idea... Maybe you can try to set
STORE_END_POINT=ilfstesting.s3-us-east-1.amazonaws.com
or just setSTORE_REGION=us-west-2
Nope... still it's not going to work :/
@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
@sbkg0002 maybe you don't need STORE_FORCE_PATH_STYLE
Lmao .. it doesn't work on Vercel either πππ³π³
@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
@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
tous-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.
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
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?
@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.
COOKIE_SECURE=false
I run in on a server, but still the winner π
Docker command: