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

[Bug] Issue with using port 3000 #868

Closed
AndreasByrsting opened this issue Jan 23, 2025 · 30 comments
Closed

[Bug] Issue with using port 3000 #868

AndreasByrsting opened this issue Jan 23, 2025 · 30 comments
Labels
bug Something isn't working

Comments

@AndreasByrsting
Copy link

AndreasByrsting commented Jan 23, 2025

Device information

  • Suwayomi-WebUI version:-
  • Suwayomi-Server version: -
  • Server Operating System: -
  • Server Desktop Environment: -
  • Server JVM version: -
  • Client Operating System: -
  • Client Web Browser: -

Steps to reproduce

  1. host on port 3000
  2. open webUI

Expected behavior

requests use port 3000

Actual behavior

requets use port 4567

Other details

This is not a functional issue, so I did not write a ticket according to the format. Below are the problems I encountered during my first Docker deployment. Please assist me in addressing them.

Currently, the issue I am facing is that the address I access in my browser is https://comic.example:3000/. Apart from the GraphQL requests, all other requests are being correctly forwarded to the local network at 192.168.0.50:4567 via Nginx. However, the GraphQL and WebSocket requests keep trying to connect to https://comic.example:4567/api/graphql. The WSS requests are also being sent to port 4567, which is causing them to be unusable. I haven't found anywhere to modify this port (I am using the official Docker version 1.1.1). Could you please help me resolve this issue?

@AndreasByrsting AndreasByrsting added the bug Something isn't working label Jan 23, 2025
@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

if you change the webui flavor to vui is it still broken?

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

(i want to know if is a client issue or something else)

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

also (in webui) settings > server > server address would be the only place the fetched address is changeable

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

and generally troubleshoot-able issues are probably better off discussed in the discord, github isn't great for conversations

@AndreasByrsting
Copy link
Author

(i want to know if is a client issue or something else)

This issue occurs when accessing via a browser from the external network. I tried changing the browser style to "vui," but it still didn't resolve the problem. Currently, I have resolved the issue by directly proxying port 4567 from the local network to port 4567 on the public network using Nginx. Therefore, my current assessment is that the WSS requests and the /api/graphql requests may be causing issues because they are directly reading the 4567 port set in the server address after being forwarded through the Nginx port. I believe this port should be the same as the browser's access port for it to make sense. Regarding Discord, I am currently unable to use it, but I will try to join when I use a personal device after some time. You know, the internet in China is not very convenient at certain times.

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

you setup nginx to upgrade the connection?

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

also why use 3000 and not 80 (or 443 if you setup ssl)?

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

i cant speak for the default webui
but the only base URL that vui connects to to server via is the one you are accessing it from
so if you are accessing it from https://comic.example:3000/ then it will only use https://comic.example:3000/api/graphql to connect to the server

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

vui does not know, or care to know what port you are using, not will it change it

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

so any redirecting that is happening is because you setup nginx wrong
and im sorry but we can't really help you with that

@AndreasByrsting
Copy link
Author

you setup nginx to upgrade the connection?

I upgraded the connection, but the upgrade was in vain due to the incorrect port for the request. If Nginx forwards from 4567 to 4567 for the upgrade, the connection works well. However, if it forwards from another port, such as 3000, to 4567 for the upgrade, it will fail.

My proxy address is 3000, so the correct request should be:
wss://comic.example:3000/api/graphql
However, it has been continuously sending requests to:
wss://comic.example:4567/api/graphql
And since the server is not configured for port 4567, it definitely won't succeed.

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

My proxy address is 3000, so the correct request should be:
wss://comic.example:3000/api/graphql
However, it has been continuously sending requests to:
wss://comic.example:4567/api/graphql
And since the server is not configured for port 4567, it definitely won't succeed.

suwayomi isn't what is changing that to 4567, thats yr nginx setup doing some weird redirecting

@AndreasByrsting
Copy link
Author

My proxy address is 3000, so the correct request should be:
wss://comic.example:3000/api/graphql
However, it has been continuously sending requests to:
wss://comic.example:4567/api/graphql
And since the server is not configured for port 4567, it definitely won't succeed.

suwayomi isn't what is changing that to 4567, thats yr nginx setup doing some weird redirecting

If that's the case, please close the issue. I will continue using port 4567, as port forwarding may not be suitable for this situation.
thanks

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

forwarding with nginx on a different port works fine ive done it in the past, you probably just set it up wrong

@AndreasByrsting
Copy link
Author

forwarding with nginx on a different port works fine ive done it in the past, you probably just set it up wrong

ok thanks I'm ready to redo it, this might be my personal mistake

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

  server {
    include commonexpl.conf;
    listen 443 ssl;
    server_name tachidesk.*;
   
    # you separate manifest.json to make pwa install work even with basic auth
    location /manifest.json {
      try_files $uri $uri/ /manifest.json;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;
    }

    location / {
      proxy_pass http://tachidesk:4567;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;

      # basic auth
      auth_basic "Private Property";
      auth_basic_user_file .htpasswd;
    }
    # ssl stuff
    ssl_certificate /etc/letsencrypt/live/****/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/****/privkey.pem;
  }

is a simplified version of what i used to use

@AndreasByrsting
Copy link
Author

server {
include commonexpl.conf;
listen 443 ssl;
server_name tachidesk.*;

# you separate manifest.json to make pwa install work even with basic auth
location /manifest.json {
  try_files $uri $uri/ /manifest.json;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $http_connection;
}

location / {
  proxy_pass http://tachidesk:4567;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $http_connection;

  # basic auth
  auth_basic "Private Property";
  auth_basic_user_file .htpasswd;
}
# ssl stuff
ssl_certificate /etc/letsencrypt/live/****/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/****/privkey.pem;

}
is a simplified version of what i used to use

I am currently using the configuration for port 4567, which is similar to this one. The usage is correct, and I can access it as soon as I enter. Thank you very much for your help. However, I will continue to research the situation of forwarding port 3000 to 4567. I will leave a message or join Discord later

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

that one does 443(remote) to 4567(local)
(https://comic.example:443/ to access it remotely)
just change the 443 (at the top) to 3000

@AndreasByrsting
Copy link
Author

that one does 443(remote) to 4567(local) (https://comic.example:443/ to access it remotely) just change the 443 (at the top) to 3000

The issue I'm encountering hasn't even reached Nginx; the port in the requests made by the browser is incorrect from the start, and it's unrelated to Nginx. We're going in the wrong direction

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

SUWAYOMI DOES NOT CHANGE THE PORT BY ITSELF

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

the only ways it can use the wrong port are

  1. you changed the server address to the wrong address (its not this cause VUI cant do that)
  2. nginx is doing a weird redirect/rewrite and telling the webui its on a different url

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

its not 1 cause that cant happen in VUI and you had the same issue in VUI
so all that is left is 2

@AndreasByrsting
Copy link
Author

the only ways it can use the wrong port are

  1. you changed the server address to the wrong address (its not this cause VUI cant do that)
  2. nginx is doing a weird redirect/rewrite and telling the webui its on a different url

I'm sorry, I didn't realize that I needed to update the UI after modifying VUI. The problem is indeed resolved. It turns out I'm a bit of an idiot. You're the best, and I apologize for taking up your time.

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

@schroda does webui not use the server address setting for the subscriptions?

@AndreasByrsting
Copy link
Author

its not 1 cause that cant happen in VUI and you had the same issue in VUI so all that is left is 2

I'm very sorry; I didn't see the prompt to update the VUI. I had to manually update the UI in the "About" section. After updating the UI, all issues were resolved, and you had no errors.

@Robonau
Copy link
Contributor

Robonau commented Jan 23, 2025

I'm very sorry; I didn't see the prompt to update the VUI. I had to manually update the UI in the "About" section. After updating the UI, all issues were resolved, and you had no errors.

yea, i got that in yr last message.

if part of webui is using a different address than elsewhere then there is an issue with webui that needs to be fixed.

@schroda
Copy link
Collaborator

schroda commented Jan 23, 2025

port 3000 is the default development port which will cause webUI to use 4567 as the servers port if not otherwise specified via the server address setting (settings > server > server address)

@Syer10 Syer10 transferred this issue from Suwayomi/Suwayomi-Server Jan 23, 2025
Copy link

@AndreasByrsting this issue was automatically closed because:

  • The title is too short to provide any valuable short description
  • The acknowledgment section was not removed

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2025
Copy link

@AndreasByrsting this issue was not reopened because:

  • The title is too short to provide any valuable short description

@schroda schroda changed the title [Bug] port issue [Bug] Issue with using port 3000 Jan 23, 2025
@schroda schroda reopened this Jan 23, 2025
@schroda
Copy link
Collaborator

schroda commented Jan 23, 2025

fixed with c42e51b

@schroda schroda closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants