standardnotes / self-hosted

[Legacy] Self-host your own Standard Notes server for end-to-end encrypted notes and files
https://github.com/standardnotes/server
GNU Affero General Public License v3.0
343 stars 39 forks source link

error while file uploading #101

Closed qwfpg closed 1 year ago

qwfpg commented 1 year ago

Service Versions (please complete the following information): Paste the output of ./server.sh version. For example:

Container                             Repository                        Tag                 Image Id            Size
api-gateway-standalone                standardnotes/api-gateway         latest              d09697a8c361        204MB
auth-standalone                       standardnotes/auth                latest              5531edecc220        218MB
auth-worker-standalone                standardnotes/auth                latest              5531edecc220        218MB
cache-standalone                      redis                             6.0-alpine          f30aed8202b4        26.3MB
db-standalone                         mysql                             5.6                 dd3b2a5dcb48        303MB
files-standalone                      standardnotes/files               latest              ac0a6f182387        206MB
syncing-server-js-standalone          standardnotes/syncing-server-js   latest              811cc093f89e        217MB
syncing-server-js-worker-standalone   standardnotes/syncing-server-js   latest              811cc093f89e        217MB

Describe the issue Hi! Getting 404 error while uploading file

Cannot POST /v1/files/upload/create-session

Nginx configured as described in doc.

server {
  server_name note.DOMAIN_MAME.in;

  access_log /var/log/nginx/standardnotes-access.log;
  error_log /var/log/nginx/standardnotes-error.log;

  client_max_body_size 50M;

  location / {
    proxy_pass http://127.0.0.1:3000;
  }

FILES_SERVER_URL=https://note.DOMAIN_NAME.in/

docker compose logs -f api-gateway
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth:3000 is unavailable yet - waiting for it to start
api-gateway-standalone  | auth (172.18.0.7:3000) open
api-gateway-standalone  | auth:3000 is up - executing command
api-gateway-standalone  | syncing-server-js (172.18.0.5:3000) open
api-gateway-standalone  | syncing-server-js:3000 is up - executing command
api-gateway-standalone  | files (172.18.0.2:3000) open
api-gateway-standalone  | files:3000 is up - executing command
api-gateway-standalone  | Starting Web...
api-gateway-standalone  | {"level":"info","message":"Server started on port 3000"}
docker compose logs -f files
files-standalone  | db (172.18.0.4:3306) open
files-standalone  | db:3306 is up - executing command
files-standalone  | cache (172.18.0.3:6379) open
files-standalone  | cache:6379 is up - executing command
files-standalone  | Starting Web...
files-standalone  | {"level":"info","message":"Server started on port 3000"}
qwfpg commented 1 year ago

Found the solution. In my case need to create another proxy rule on 3125 port.

server {
  server_name notes-files.DOMAIN_MAME.in;
  client_max_body_size 50M;

  location / {
    proxy_pass http://127.0.0.1:3125;
  }

And then in you .env

FILES_SERVER_URL=notes-files.DOMAIN_MAME.in

More details in discord Thread https://discord.com/channels/894600255058898974/949027665241845821/1050833907748188280