actualbudget / actual-server

Actual's server
https://actualbudget.org
MIT License
3.23k stars 625 forks source link

[Feature request]: Actual Server fails to start when host has IPV6 disabled #336

Open Krupski19 opened 7 months ago

Krupski19 commented 7 months ago

Verified issue does not already exist?

What happened?

When trying to start actual-server locally or through Docker on a host that has IPv6 disabled, the server fails to start as it tries to bind port 5006 to :: on IPV6. With IPV6 being disabled on the host through the kernel, the bind fails and actual-server is unable to start.

What error did you receive?

Checking if there are any migrations to run for direction "up"...

Migrations: DONE

Listening on :::5006...

node:events:495

      throw er; // Unhandled 'error' event

      ^

Error: listen EAFNOSUPPORT: address family not supported :::5006

    at Server.setupListenHandle [as _listen2] (node:net:1800:21)

    at listenInCluster (node:net:1865:12)

    at doListen (node:net:2014:7)

    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Emitted 'error' event on Server instance at:

    at emitErrorNT (node:net:1844:8)

    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

  code: 'EAFNOSUPPORT',

  errno: -97,

  syscall: 'listen',

  address: '::',



Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Linux

etay1 commented 6 months ago

Hi, is anyone working on this feature already or can I hack at it?

dl1ch commented 5 months ago

Just add "ACTUAL_HOSTNAME=0.0.0.0" to your environment variable and should work.

DarkWolfSLV commented 3 weeks ago

Just add "ACTUAL_HOSTNAME=0.0.0.0" to your environment variable and should work.

Can you elaborate on the workaround?

dl1ch commented 3 weeks ago

Well, the mentioned variable sets the listening IP to all IPv4 interfaces so it doesn't try to listen on any IPv6 interface, thus not causing the mentioned errors by the OP. This solved the same issue when I tried to run the containerized version of actual server.

DarkWolfSLV commented 3 weeks ago

Well, the mentioned variable sets the listening IP to all IPv4 interfaces so it doesn't try to listen on any IPv6 interface, thus not causing the mentioned errors by the OP. This solved the same issue when I tried to run the containerized version of actual server.

Sorry, I'm new to this, but to which file exactly do you add "ACTUAL_HOSTNAME=0.0.0.0"? In Ubuntu I tried with export "server1=0.0.0.0" or adding it to /etc/environment, which didn't solve the crash. Does it need to be added directly to one of the container files?

daveofca commented 3 weeks ago

If you're hoisting with Docker Compose, it looks like it can be added to that file as an Environment Variable. If not, the docs mentioned Config.json file in the installation. https://actualbudget.org/docs/config/

Best regards,

dn

On Thu, Oct 24, 2024 at 7:39 AM DarkWolfSLV @.***> wrote:

Well, the mentioned variable sets the listening IP to all IPv4 interfaces so it doesn't try to listen on any IPv6 interface, thus not causing the mentioned errors by the OP. This solved the same issue when I tried to run the containerized version of actual server.

Sorry, I'm new to this, but to which file exactly do you add "ACTUAL_HOSTNAME=0.0.0.0"? In Ubuntu I tried with export "server1=0.0.0.0" or adding it to /etc/environment, which didn't solve the crash. Does it need to be added directly to one of the container files?

— Reply to this email directly, view it on GitHub https://github.com/actualbudget/actual-server/issues/336#issuecomment-2435327842, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYJNJWF7VCXSAII6EETJYDZ5D2CFAVCNFSM6AAAAABGBN2T2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZVGMZDOOBUGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>