Comments (29)
@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.
@ilovefreesw You are missing STORE_END_POINT
from notea.
Please take a look at docker log.
Did you manually create the bucket?
from notea.
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.
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.
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.
@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 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.
Thanks @QingWei-Li . Using the provided Minio compose + the example .env
file - which has STORE_END_POINT
, I still get this error.
from notea.
@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 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.
@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.
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.
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.
@ilovefreesw Maybe your key belongs to s3-us-west-2
not us-east-1
.
from notea.
@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.
from notea.
I'm using S3 compatible service by Exoscale.
How that works for you. I get error in that as well.
from notea.
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.
@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.
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.
@sbkg0002 What is the latest error log
from notea.
@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 :/
from notea.
@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.
@sbkg0002 maybe you don't need STORE_FORCE_PATH_STYLE
from notea.
Lmao .. it doesn't work on Vercel either ๐๐๐ณ๐ณ
from notea.
@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
from 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?
from notea.
@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.
COOKIE_SECURE=false
I run in on a server, but still the winner ๐
from notea.
Related Issues (20)
- Replacement for `rich-markdown-editor` HOT 1
- 500 internal error (vercel. notify) HOT 2
- Better internationalisation system HOT 5
- Footer label in shared documents HOT 1
- Unable to parse (uuid) HOT 2
- Next.JS client side exception HOT 7
- Build fail while resolve dependency HOT 3
- Simultaneous editing HOT 1
- Miscellaneous file system
- Is it any chance for you to add an extension for uploading the images to SMMS directly instead of S3? HOT 4
- Reformats old Paragraph when i start with Slash HOT 2
- Better ultrawide support HOT 13
- Share entire folders HOT 2
- Exporting notes with slashes in name causes new directories
- Helm Chart for Kubernetes HOT 3
- [Feature Request] Password-protected encrypted notes HOT 1
- ใbugใTitles problem of the notea
- docker้จ็ฝฒๅฏๅจๅๆ็คบๅฏ็ ไธๆญฃ็กฎ HOT 1
- Information leak: Last visit redirect is triggered also for anonymous requests (public home page, if shared document) HOT 4
- Group efforts and a first community release HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notea.