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

Unable to resolve backend... again #320

Closed
PseudoMortus opened this issue Aug 15, 2024 · 13 comments
Closed

Unable to resolve backend... again #320

PseudoMortus opened this issue Aug 15, 2024 · 13 comments

Comments

@PseudoMortus
Copy link

PseudoMortus commented Aug 15, 2024

Hey there, I'm trying to get my domain to work with the server, and am facing the unresolved backend issue others on here have faced. I've gone through and verified my situation doesn't seem to match any previously by verifying my domain was not the example and it was matching (it wasn't, though it seems to be pointing to the proxmox hosting the container this is in, so might not be related in issue), nor is tied to SRV (it may have been at first, though after deleting srv record, problem persists). I have applied true to DEBUG, and this is what I'm facing:

time="2024-08-15T01:36:30Z" level=debug msg="Debug logs enabled"
time="2024-08-15T01:36:30Z" level=info msg="Created route mapping" backend="forge:25565" serverAddress="pseudo-services.lan\\x00fml3\\x00"
time="2024-08-15T01:36:30Z" level=info msg="Listening for Minecraft client connections" listenAddress=":25565"
time="2024-08-15T01:36:37Z" level=info msg="Got connection" client="[insert_ip_here]:45840"
time="2024-08-15T01:36:37Z" level=debug msg="Reading packet" client="[insert_ip_here]:45840"
time="2024-08-15T01:36:37Z" level=debug msg="Reading frame" client="[insert_ip_here]:45840"
time="2024-08-15T01:36:37Z" level=debug msg="Read frame length" client="[insert_ip_here]:45840" length=32
time="2024-08-15T01:36:37Z" level=debug msg="Reading frame content" client="[insert_ip_here]:45840" length=32 total=32
time="2024-08-15T01:36:37Z" level=debug msg="Read frame" client="[insert_ip_here]:45840" frame="Frame:[len=32, payload=0X00FB051970736575646F2D73657276696365732E6C616E00464D4C330063DD02]"
time="2024-08-15T01:36:37Z" level=debug msg="Read packet" client="[insert_ip_here]:45840" packet="Frame:[len=32, packetId=0, data=0XFB051970736575646F2D73657276696365732E6C616E00464D4C330063DD02]"
time="2024-08-15T01:36:37Z" level=debug msg="Got packet" client="[insert_ip_here]:45840" length=32 packetID=0
time="2024-08-15T01:36:37Z" level=debug msg="Got handshake" client="[insert_ip_here]:45840" handshake="&{763 pseudo-services.lan\x00FML3\x00 25565 2}"
time="2024-08-15T01:36:37Z" level=debug msg="Finding backend for server address" serverAddress="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T01:36:37Z" level=warning msg="Unable to find registered backend" resolvedHost=pseudo-services.lan serverAddress="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T01:36:37Z" level=debug msg="Closing frontend connection" client="[insert_ip_here]:45840"

My docker compose is as follows

name: adoring_jorja
services:
  forge:
    cpu_shares: 90
    command: []
    container_name: 1-20-1_Dungeons_Server
    deploy:
      resources:
        limits:
          memory: 12288M
    environment:
      - EULA=TRUE
      - TYPE=FORGE
    hostname: 1-20-1_Dungeons_Server
    image: itzg/minecraft-server:latest
    labels:
      icon: https://icon.casaos.io/main/all/mc-router.png
    restart: unless-stopped
    ports: []
    volumes: []
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
  router:
    cpu_shares: 90
    command: []
    container_name: 1-20-1_Dungeons_Router
    depends_on:
      forge:
        condition: service_started
        required: true
    deploy:
      resources:
        limits:
          memory: 12288M
    environment:
      - DEBUG=true
      - MAPPING=pseudo-services.lan\x00FML3\x00=forge:25565
    hostname: 1-20-1_Dungeons_Router
    image: itzg/mc-router:latest
    labels:
      icon: https://icon.casaos.io/main/all/mc-router.png
    ports:
      - target: 25565
        published: "25565"
        protocol: tcp
    restart: unless-stopped
    volumes: []
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
x-casaos:
  author: self
  category: self
  hostname: ""
  icon: https://icon.casaos.io/main/all/mc-router.png
  index: /
  is_uncontrolled: false
  port_map: ""
  scheme: http
  store_app_id: adoring_jorja
  title:
    custom: 1.20.1 Dungeons

The domain people are supposed to connect with is dungeons.pseudoservices.com, however due to the logs saying it couldn't find a backend for pseudo-services.lan, tried that as well as the extra bits past the backslash. I also use CasaOS on an Ubuntu 23.04 containerized server via Proxmox if that helps. This is also occurring via connection via IP and not domain, domain seems to have a different issue, though I wanna toy with this first.

@itzg
Copy link
Owner

itzg commented Aug 15, 2024

Don't include the null delimited bit \x00FML3\x00 in your server address mapping. My apologies, the debug log you're seeing is not correctly showing the final address being evaluated, which is "pseudo-services.lan" in your case.

@PseudoMortus
Copy link
Author

PseudoMortus commented Aug 15, 2024

I had tried that as well to no avail, adding that bit was post the pseudo-services.lan not working.

I verified again, just to be sure, and got these logs:

time="2024-08-15T03:45:59Z" level=debug msg="Debug logs enabled"
time="2024-08-15T03:45:59Z" level=info msg="Created route mapping" backend="forge:25565" serverAddress=pseudo-services.lan
time="2024-08-15T03:45:59Z" level=info msg="Listening for Minecraft client connections" listenAddress=":25565"
time="2024-08-15T03:46:20Z" level=info msg="Got connection" client="[insert_ip_here]:42872"
time="2024-08-15T03:46:20Z" level=debug msg="Reading packet" client="[insert_ip_here]:42872"
time="2024-08-15T03:46:21Z" level=debug msg="Reading frame" client="[insert_ip_here]:42872"
time="2024-08-15T03:46:21Z" level=debug msg="Read frame length" client="[insert_ip_here]:42872" length=32
time="2024-08-15T03:46:21Z" level=debug msg="Reading frame content" client="[insert_ip_here]:42872" length=32 total=32
time="2024-08-15T03:46:21Z" level=debug msg="Read frame" client="[insert_ip_here]:42872" frame="Frame:[len=32, payload=0X00FB051970736575646F2D73657276696365732E6C616E00464D4C330063DD02]"
time="2024-08-15T03:46:21Z" level=debug msg="Read packet" client="[insert_ip_here]:42872" packet="Frame:[len=32, packetId=0, data=0XFB051970736575646F2D73657276696365732E6C616E00464D4C330063DD02]"
time="2024-08-15T03:46:21Z" level=debug msg="Got packet" client="[insert_ip_here]:42872" length=32 packetID=0
time="2024-08-15T03:46:21Z" level=debug msg="Got handshake" client="[insert_ip_here]:42872" handshake="&{763 pseudo-services.lan\x00FML3\x00 25565 2}"
time="2024-08-15T03:46:21Z" level=debug msg="Finding backend for server address" serverAddress="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T03:46:21Z" level=info msg="Connecting to backend" backendHostPort="forge:25565" client="[insert_ip_here]:42872" server="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T03:46:21Z" level=warning msg="Unable to connect to backend" backend="forge:25565" client="[insert_ip_here]:42872" error="dial tcp: lookup forge on 192.168.86.1:53: no such host" serverAddress="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T03:46:21Z" level=debug msg="Closing frontend connection" client="[insert_ip_here]:42872"

I also figured out the domain issue with another server host, but the fix to get that goin doesn't seem to connect here either still.

@itzg
Copy link
Owner

itzg commented Aug 15, 2024

If you need further help please provide the latest config and debug logs.

@PseudoMortus
Copy link
Author

PseudoMortus commented Aug 15, 2024

The latest debug logs I posted already, however here's my latest config if I'm understanding your request correctly

name: adoring_jorja
services:
  forge:
    cpu_shares: 90
    command: []
    container_name: 1-20-1_Dungeons_Server
    deploy:
      resources:
        limits:
          memory: 12288M
    environment:
      - EULA=TRUE
      - TYPE=FORGE
    hostname: 1-20-1_Dungeons_Server
    image: itzg/minecraft-server:latest
    labels:
      icon: https://icon.casaos.io/main/all/mc-router.png
    restart: unless-stopped
    ports: []
    volumes: []
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
  router:
    cpu_shares: 90
    command: []
    container_name: 1-20-1_Dungeons_Router
    depends_on:
      forge:
        condition: service_started
        required: true
    deploy:
      resources:
        limits:
          memory: 12288M
    environment:
      - DEBUG=true
      - MAPPING=pseudo-services.lan=forge:25565
    hostname: 1-20-1_Dungeons_Router
    image: itzg/mc-router:latest
    labels:
      icon: https://icon.casaos.io/main/all/mc-router.png
    ports:
      - target: 25565
        published: "25565"
        protocol: tcp
    restart: unless-stopped
    volumes: []
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
x-casaos:
  author: self
  category: self
  hostname: ""
  icon: https://icon.casaos.io/main/all/mc-router.png
  index: /
  is_uncontrolled: false
  port_map: ""
  scheme: http
  store_app_id: adoring_jorja
  title:
    custom: 1.20.1 Dungeons

@PseudoMortus
Copy link
Author

Idk why it defaulted with closing with comment, but fixed that, apologies.

@itzg
Copy link
Owner

itzg commented Aug 15, 2024

Now you have a different issue where you don't have a "forge" container that can be resolved

time="2024-08-15T03:46:21Z" level=info msg="Connecting to backend" backendHostPort="forge:25565" client="[insert_ip_here]:42872" server="pseudo-services.lan\x00FML3\x00"
time="2024-08-15T03:46:21Z" level=warning msg="Unable to connect to backend" backend="forge:25565" client="[insert_ip_here]:42872" error="dial tcp: lookup forge on 192.168.86.1:53: no such host" serverAddress="pseudo-services.lan\x00FML3\x00"

@PseudoMortus
Copy link
Author

PseudoMortus commented Aug 15, 2024

As in the forge container isn't running in a way that the router can contact?

No, it might have something to do with that lookup forge isn't it? I'm checking into what might be causing the different IP #

@itzg
Copy link
Owner

itzg commented Aug 15, 2024

Correct

error="dial tcp: lookup forge on 192.168.86.1:53: no such host

@PseudoMortus
Copy link
Author

I'm looking into it further, and realized I don't know why it would be looking on that IP. Is there anything in the router container to point to the router hardware?

@itzg
Copy link
Owner

itzg commented Aug 16, 2024

That IP address could be Docker's DNS for container/service resolution. It means the forge container isn't running or is not resolvable within that container network. Or your docker networking is now not setup correctly.

@PseudoMortus
Copy link
Author

Wait, is the "forge.example.com=forge:25565" then saying, "[insert_domain_here]=[insert_network_here]:[insert_port_here]?"

@itzg
Copy link
Owner

itzg commented Aug 16, 2024

Wait, is the "forge.example.com=forge:25565" then saying, "[insert_domain_here]=[insert_network_here]:[insert_port_here]?"

I don't know what that's saying or what you're asking exactly. I thought you manually redacted the values. I'm not sure if I can help any further since your problem scenario keeps changing.

Does looking at this again help answer your question?

https://github.com/itzg/mc-router#docker-compose-usage

@PseudoMortus
Copy link
Author

PseudoMortus commented Aug 16, 2024

That's fine, just verified it myself, and I can connect via IP now. For clarification, I was curious if the format for the mapping line in the compose file was the domain that connects to the server is to point to the network the server is running on and its port, so in this case I needed to change the network of the server to forge rather than what it was on, bridge.

As for if the usage bit helped, not inherently. It took realizing the potential format of that line to realize what I needed to change, in which case that ended up helping in that regard. Just realized had I started from the top it probably would have, as it mentions the network part in the first paragraph, I are had sumb.

Either way, TL;DR, updating the network the server was connected to was what was needed. I do thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants