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] No available IPs on the server #17

Open
whlack opened this issue Oct 25, 2023 · 5 comments
Open

[BUG] No available IPs on the server #17

whlack opened this issue Oct 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@whlack
Copy link

whlack commented Oct 25, 2023

No available IPs on the server
After sending a postman request to add a key, it's returning:

data: { 
  response: 'No available IPs on the server' 
}

Also, on my logs of docker container i can see UNIQUE constraint failed message:

/usr/src/wireguard-manager-and-api/src/db/db.go:108 UNIQUE constraint failed: ips.ipv6_address
[0.096ms] [rows:0] INSERT INTO `ips` (`ipv4_address`,`ipv6_address`,`in_use`,`wg_interface`) VALUES ("10.6.1.108","-","false","wg0")

My configs is:
MAX_IP: 350
ADDRESS: 10.8.0.1
SUBNET: /16

@whlack
Copy link
Author

whlack commented Oct 25, 2023

okay, it looks like i got a problem. when it generates ip addresses, (IPv6 is disabled), it's trying to set ipv6_address to "-" everywhere, so it fails UNIQUE key. @RaspberryTech01

@RaspberryTech01
Copy link
Contributor

Interesting, how are you setting the IPv6 addresses in the config?

INSTANCE.IP.GLOBAL.ADDRESS.IPV6 what is this value in your config?

@RaspberryTech01 RaspberryTech01 added the bug Something isn't working label Oct 28, 2023
@whlack
Copy link
Author

whlack commented Oct 28, 2023

INSTANCE.IP.GLOBAL.ADDRESS.IPV6 = [ "2001:19f0:6c00:1bf2::64" ]

bug reproduces when instance.ip.local.ipv6.enabled = false;
workaround is enable ipv6, anyway it's not supported in docker

@RaspberryTech01
Copy link
Contributor

That is correct, I never got ipv6 working in docker. Whilst its not a solution I suggest keeping it like that as it doesn't hurt.

@whlack
Copy link
Author

whlack commented Oct 28, 2023

okay, but i suggest to set ipv6 in database field to nullable (keep unique key), and set it to null if IPv6 is disabled

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

2 participants