Lancache, Raspbery-pi and DNS problems

Hello forum.

I am going nuts over here.

I am trying to set up a lancache with a raspberry-pi and a NAS.
However, my problems do not lie there. I have mounted the nas as storage and the raspberry pi and the lancache container have access to it and can write to the nas.

What I am struggling with is the DNS. When I switch my windows clients to the new lancache ip. all the DNS requests time out in 2 seconds.

I have tried changing IP’s, changing upstream DNS in the lancache (to my router and cloudflare and both). Any combination of these and I never get a response. At this point I have no clue what is going on.

I have set 2 static IP’s in raspbian in dhcpcd.conf and they seem to work. I have full internet access from the pi. It just seems to me that no matter what I do the containers cant reach the DNS or are set to a wrong one.

Anyone have any idea what I could be doing wrong? I can share any and all files if more info is needed.

UPDATE: Found out that all 3 containers were restarting constantly. I have no idea why. Portainer just said that they were running. So I will investigate further.

UPDATE2: I am an idiot. Wasn’t running ARM version of lancache. DNS works now. Monolithic ceeps restarting. My pi 3 might not be able to run this /:

I suspect there’s a classic case of 2 DHCP servers in a single network here. Are you sure there’s only one?

Anyway, post the contents of the various config files for DHCP and DNS clients/hosts. Use code tags please! (enclose in between 3 back-ticks each)
like this

1 Like

I think the only one should be my router. UPDATE… I disabled DHPC on the pi and added this to /etc/networking/interfaces. Yet the same problem persists. All help very appreciated!

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.0.0.50/24
gateway 10.0.0.1

 auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 10.0.0.51/24

auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
address 10.0.0.52/24

This is the lancache .env variables

LANCACHE_IP=10.0.0.50 10.0.0.51
DNS_BIND_IP=10.0.0.50
UPSTREAM_DNS=1.1.1.1

These are current the settings in the lanchache .env (as you can see I tried using cloudflare instead of my router but that changed nothing)

Idk if I am missing some files. But just let me know and I will add them to this comment

You’re running all three Lancache containers right? Also any output from docker events?

Yes. All 3 are running. Just found out however that they keep restarting. So that might be why I only get a timeout. I don’t know where to look for logs as to why they are restarting. I will investigate further

docker logs -container name- will output logs

1 Like

Okei so the logs are endless. It just ceeps scrolling. Its stuck in some sort of loop.

Checking nginx config
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] chown("/data/cache/cache", 33) failed (20: Not a directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
ERROR: hook /hooks/supervisord-pre.d/99_config_check.sh} returned a non-zero exit status '0'
Executing hook /hooks/entrypoint-pre.d/00_asciilogo.sh

This is the last error before it loops back to the start of its config. I don’t really understand what is going on. Those seem to be the errors causing the ‘restarts’.

It says in on the github page

NTFS/FAT32 external drives will not work. nginx tries to chown , which doesn’t play nice with Microsoft filesystems. Please use a nix filesystem such as ext4

However the filesystem is a NAS that is ext3 … so that should not be the problem. Could this be an access rights problem. Do I need to grant the PI rw somehow ???

Can you please check if /data/cache/cache exists and is a directory and not a file?

Yea I just don’t understand where that should be.
the root structure for lancache is NAS/lancache/cache/cache/

Look at the docker-compose file and the .env file.

You are going to want to edit the value of CACHE_ROOT in .env to where you actually want the cached data to live, or well actually one directory above that. So if you want the cached data in /NAS/lancache/cache then edit it to CACHE_ROOT=/NAS/lancache and make sure the directory /NAS/lancache/cache exists.

CACHE_ROOT=/home/pi/NAS/lancache/data/

That is how that line looks. And yes the dir does exist and is not a file.

And NAS is a network mounted folder on my NAS

Does /home/pi/NAS/lancache/data/cache exist and is a directory? Because if you look in the docker-compose file, it actually is mounting ${CACHE_ROOT}/cache not just ${CACHE_ROOT}

So /home/pi/NAS is a folder that you NAS is sharing and is mounted on home/pi?

I think the only share type that would work well is iSCSI, if that is what you are doing.

No right now its mounted with cifs.
in fstab

//10.0.0.7/Volume_1 /home/pi/NAS cifs guest,rw,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,vers=1.0

I see that people on reddit had good luck with ISCSI but I cant seem to find any good info on mounting a NAS with it…

Try temporarily changing the cache directory to something local on the PI’s SD card. If that fixes it, then it is definitely an issue with the network drive.

As for iSCSI, it depends on what type of NAS you have.

Well its a pretty old one. D-link DNS-323… so might be that.
Was really hoping I could do it with SMB1 but seems not to be possible /:expressionless:

OK. So Now I have plugged in a USB and tried to use that as storage. Nothing. No errors. Everything runs. Yet no files get created. No cache is cached just like with the NAS.

Like it should work. But its not doing anything. And I see no errors in any logs. Its just not caching…

I have my client pointed at the PI’s IP. It lists the IP’s when I do an nslookup.
All the containers are running without errors…

I have no idea how to go forwards