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

Couldn't save to backend database, backend storage cant be accessed. #30

Closed
rogerc66 opened this issue Sep 29, 2023 · 12 comments
Closed
Labels
support Support user's cases(community driven)

Comments

@rogerc66
Copy link

rogerc66 commented Sep 29, 2023

Screenshot 2023-09-29 at 10 50 08 AM

Image 9-29-23 at 10 51 AM

Screenshot 2023-09-29 at 10 57 12 AM

Screenshot 2023-09-29 at 11 01 53 AM

Screenshot 2023-09-29 at 11 00 42 AM

Screenshot 2023-09-29 at 11 28 06 AM

Screenshot 2023-09-29 at 11 00 33 AM

I have managed to get collaboration room working, but I cant have backend storage up there, I got 404 error when trying to access the backend in browser.

I have read past issues and did all tricks but have no luck, I have reverse proxy of 3 ports (https:8006->http:8000, 8007->8001, 8008->8002) on my NAS to use https, still not working, I have noticed there is no redis container in my docker ps, could that be the problem?

@rogerc66
Copy link
Author

rogerc66 commented Sep 29, 2023

I have make images again and now it works, however, the collaboration is not really realtime though, I have to refresh the share link for peer to see what has changed in drawing. is this normal?

Does it suppose to update the canvas in heartbeat? anywhere shoud I look into?

@rogerc66
Copy link
Author

Now I have everything works well except save to sharing link, the realtime team work works flawlessly.

I have read others sharing link troubleshoots but non works for me.

https://mydomain:8007/api/v2/post/ returns 404, /api/v2/post not found, any idea?

@yinhuihe
Copy link

yinhuihe commented Oct 2, 2023

#28

@rogerc66
Copy link
Author

rogerc66 commented Oct 2, 2023

#28

This doesnt do the magic for me

from console, "/usr/share/nginx/html/api/v2/scenes/ failed open, no such file or directory, what path suppose to be correct one?

I'm hosting on my NAS and expose the service to WAN, so that my friends can playing with it, collaboration room works like charm, but save to sharing link it not work, although it is not a big matter, but I still wondering why.

I'm using 8006 as gate port, am I suppose to set https://myowndomain:8006/**api/v2/scenes/** ? I tried setting and after remake image, it's still not working, looks like the path it mirrored is not correct, but I dont know how to identify the correct one.

Edit:
I have checked the docker folder, there is indeed no api folder inside /usr/share/nginx/html/ , any idea how to solve it?

@WenThing
Copy link

WenThing commented Oct 3, 2023

Hi =)

Seeing the error "/usr/share/nginx/html/api/v2/scenes/", I assume an nginx is used to proxy pass the https url to different port, so I attach my nginx conf file below just to help:

# this is nginx application conf that should be in conf.d
server{
    listen 80;
    server_name <domain-name>;

    location / {
       return 301 https://$host$request_uri;
    }
}

server{
    listen 443 ssl;

    server_name <domain-name>;

    <ssl cert configuration is here, removed for the sake of clean reading>

    location /socket.io {
        proxy_pass http://**excalidraw-room**:<your port>;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
    }

    location /api/v2 {
        proxy_set_header Host $host;
        proxy_pass http://**excalidraw-storage-backend**:<your port>;
    }

    location / {
       proxy_set_header Host $host;
       proxy_pass http://**excalidraw**:<your port>;
    }
}

p/s: just to clarify, http://excalidraw-room <--- this excalidraw-room is the docker container name that runs the excalidraw room, do change it accordingly.

Additional notes:

  1. ALL of the environment URLs (BACKEND_V2_GET_URL etc.) are in my excalidraw.env.production file, I didn't list them as environment in my docker-compose.yml file.

  2. I removed ports from all the environment URLs, example:

REACT_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/scenes/
REACT_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/scenes/
REACT_APP_HTTP_STORAGE_BACKEND_URL=https://test.com/api/v2
REACT_APP_PORTAL_URL=https://test.com
REACT_APP_WS_SERVER_URL=https://test.com
REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
  1. I also received same error "Couldn't save to the backend" till I checked & confirmed the confidential to login redis/mysql is correct, changed the environment urls to https without port numbers, changed the nginx conf file, and repackage the project (make image / make patch image). After repackage, docker compose up, everything work~

Hope these will help to set it running =)

@rogerc66
Copy link
Author

rogerc66 commented Oct 3, 2023

Hi =)

Seeing the error "/usr/share/nginx/html/api/v2/scenes/", I assume an nginx is used to proxy pass the https url to different port, so I attach my nginx conf file below just to help:

# this is nginx application conf that should be in conf.d
server{
    listen 80;
    server_name <domain-name>;

    location / {
       return 301 https://$host$request_uri;
    }
}

server{
    listen 443 ssl;

    server_name <domain-name>;

    <ssl cert configuration is here, removed for the sake of clean reading>

    location /socket.io {
        proxy_pass http://**excalidraw-room**:<your port>;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
    }

    location /api/v2 {
        proxy_set_header Host $host;
        proxy_pass http://**excalidraw-storage-backend**:<your port>;
    }

    location / {
       proxy_set_header Host $host;
       proxy_pass http://**excalidraw**:<your port>;
    }
}

p/s: just to clarify, http://excalidraw-room <--- this excalidraw-room is the docker container name that runs the excalidraw room, do change it accordingly.

Additional notes:

  1. ALL of the environment URLs (BACKEND_V2_GET_URL etc.) are in my excalidraw.env.production file, I didn't list them as environment in my docker-compose.yml file.
  2. I removed ports from all the environment URLs, example:
REACT_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/scenes/
REACT_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/scenes/
REACT_APP_HTTP_STORAGE_BACKEND_URL=https://test.com/api/v2
REACT_APP_PORTAL_URL=https://test.com
REACT_APP_WS_SERVER_URL=https://test.com
REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
  1. I also received same error "Couldn't save to the backend" till I checked & confirmed the confidential to login redis/mysql is correct, changed the environment urls to https without port numbers, changed the nginx conf file, and repackage the project (make image / make patch image). After repackage, docker compose up, everything work~

Hope these will help to set it running =)

Thank you for your input.

Are you using nginx inside or outside of the docker?

@WenThing
Copy link

WenThing commented Oct 3, 2023 via email

@rogerc66
Copy link
Author

rogerc66 commented Oct 4, 2023

Nginx is deployed as docker container and connected with the excalidraw containers via docker bridge network. Since all containers are in a same bridge network, no ports exposed in docker compose, and I can proxy pass from the nginx to the excalidraw containers by calling the name of the excalidraw containers.

On Tue, 3 Oct 2023, 22:07 rogerc66, @.> wrote: Hi =) Seeing the error "/usr/share/nginx/html/api/v2/scenes/", I assume an nginx is used to proxy pass the https url to different port, so I attach my nginx conf file below just to help: # this is nginx application conf that should be in conf.d server{ listen 80; server_name ; location / { return 301 https://$host$request_uri; } } server{ listen 443 ssl; server_name ; <ssl cert configuration is here, removed for the sake of clean reading> location /socket.io { proxy_pass http://excalidraw-room:; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } location /api/v2 { proxy_set_header Host $host; proxy_pass http://excalidraw-storage-backend:; } location / { proxy_set_header Host $host; proxy_pass http://excalidraw:; } } p/s: just to clarify, http://excalidraw-room <--- this excalidraw-room is the docker container name that runs the excalidraw room, do change it accordingly. Additional notes: 1. ALL of the environment URLs (BACKEND_V2_GET_URL etc.) are in my excalidraw.env.production file, I didn't list them as environment in my docker-compose.yml file. 2. I removed ports from all the environment URLs, example: REACT_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/scenes/ REACT_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/scenes/ REACT_APP_HTTP_STORAGE_BACKEND_URL=https://test.com/api/v2 REACT_APP_PORTAL_URL=https://test.com https://test.com/api/v2/scenes/REACT_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/scenes/REACT_APP_HTTP_STORAGE_BACKEND_URL=https://test.com/api/v2REACT_APP_PORTAL_URL=https://test.com REACT_APP_WS_SERVER_URL=https://test.com REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com 1. I also received same error "Couldn't save to the backend" till I checked & confirmed the confidential to login redis/mysql is correct, changed the environment urls to https without port numbers, changed the nginx conf file, and repackage the project (make image / make patch image). After repackage, docker compose up, everything work~ Hope these will help to set it running =) Thank you for your input. Are you using nginx inside or outside of the docker? — Reply to this email directly, view it on GitHub <#30 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT5UFF3MZYNIROTPT3LVD3LX5QL35AVCNFSM6AAAAAA5L3GDRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGA2TKNBYGA . You are receiving this because you commented.Message ID: @.>

Understood, I use nginx to hosting other projects in a contrainer, I will launch another nginx contrainer try the setup, could you confirm that inside excalidraw frontend contrainer, inside /usr/share/nginx/html/ folder, is there /api folder? I have used docker container cp excalidraw:/usr/share/nginx/html /root/.excalidraw/
to copy the contents of the folder and there is no api folder actually inside.

@WenThing
Copy link

WenThing commented Oct 9, 2023

Hi, I was away past few days.

To your question, no, there is no /api folder in the /usr/share/nginx/html folder. My understanding is any url request for /api will be routed to the 'excalidraw-storage-backend' container, please refer to my nginx conf above (location /api/v2 part).

I also use nginx hosting different projects. I use server name (https://test.com) to catch any requests to excalidraw, and proxy-pass to different docker containers based on the url requests, for example the https://test.com/api is proxy-pass to excalidraw-storage-backend.

@rogerc66
Copy link
Author

Hi, I was away past few days.

To your question, no, there is no /api folder in the /usr/share/nginx/html folder. My understanding is any url request for /api will be routed to the 'excalidraw-storage-backend' container, please refer to my nginx conf above (location /api/v2 part).

I also use nginx hosting different projects. I use server name (https://test.com) to catch any requests to excalidraw, and proxy-pass to different docker containers based on the url requests, for example the https://test.com/api is proxy-pass to excalidraw-storage-backend.

Thank you for your clarification, I will try when I got time

@alswl
Copy link
Owner

alswl commented Dec 20, 2023

Maybe you can try the latest version, the setup will be easier.

@alswl alswl added the support Support user's cases(community driven) label Feb 15, 2024
@alswl
Copy link
Owner

alswl commented Feb 15, 2024

Closed for time out.

@alswl alswl closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support user's cases(community driven)
Projects
None yet
Development

No branches or pull requests

4 participants