Abort due to insufficent resources

Abort due to insufficent resources

Postby wd9895 » Sun Mar 20, 2016 2:53 pm

Hi,

I tried to copy hundreds of thousand files from my PC HDD to my Lacie NWS2, FW16.1, and it fails after a few thousand files.
The error message is "not enough resources for the service" and it's independent of using the file explorer, robocopy or simple xcopy command unter Win7 Pro 64.

I also re-installed the regualr kernel to avoid a mix with the beta 4.3.3. kernel but that doen't help as well.

The NWS2 won't be accessible via the network but the webinterface is still alive, so I can reboot. After the reboot the NAS is available again.

Do you have any hint how to go ahead ?
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: Abort due to insufficent resources

Postby fvdw » Sun Mar 20, 2016 6:09 pm

Did you check the samba log file for errors? Seems an issue with the samba server. Did you try FTP?
I copy frequently batches of about 20 thousand files and have no issues.

What you experiece smells like a memory leak issue. You could repeat what you while running the Comman "top" in a linux command window usuing ssh server. You will see if sambacis eating up all your memory
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Abort due to insufficent resources

Postby wd9895 » Sun Mar 20, 2016 6:49 pm

FTP is still running, Samba stops somewhere in the copy process.

Log file in /var/log/samba

[2016/03/20 19:12:44, 0] smbd/server.c:main(942) smbd version 3.0.37 started. Copyright Andrew Tridgell and the Samba Team 1992-2009
[2016/03/20 19:12:45, 0] passdb/pdb_smbpasswd.c:build_sam_account(1252) build_sam_account: smbpasswd database is corrupt! username xxxxx with uid 1002 is not in unix passwd database!
[2016/03/20 19:17:06, 0] lib/util_sock.c:read_data(534) read_data: read failure for 4 bytes to client 192.168.178.20. Error = Connection reset by peer
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: Abort due to insufficent resources

Postby fvdw » Sun Mar 20, 2016 7:00 pm

Mmm...this error is probably caused by your windows 7 pc.
Adapting security settings may solve this.

How? Just do google search with "read failure for 4 bytes to client" and you will find the instructions
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Abort due to insufficent resources

Postby wd9895 » Sun Mar 20, 2016 7:01 pm

[2016/03/20 19:51:36, 0] lib/util.c:smb_panic(1633)
PANIC (pid 1642): Could not store share mode entry



[2016/03/20 19:51:36, 0] lib/util.c:log_stack_trace(1737)
BACKTRACE: 0 stack frames:


[2016/03/20 19:51:36, 0] lib/fault.c:dump_core(181)
dumping core in /var/log/samba/cores/smbd


[2016/03/20 19:51:36, 0] lib/util_tdb.c:tdb_log(664)
tdb(/usr/var/locks/connections.tdb): expand_file write of 1024 bytes failed (No space left on device)


[2016/03/20 19:51:36, 0] smbd/connection.c:claim_connection(208)
claim_connection: tdb_store failed with error IO Error.


[2016/03/20 19:51:36, 0] lib/util_tdb.c:tdb_log(664)
tdb(/usr/var/locks/connections.tdb): expand_file write of 1024 bytes failed (No space left on device)


[2016/03/20 19:51:36, 0] smbd/connection.c:claim_connection(208)
claim_connection: tdb_store failed with error Record does not exist.
[2016/03/20 19:51:36, 1] smbd/service.c:make_connection_snum(905)
too many connections - rejected
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: Abort due to insufficent resources

Postby fvdw » Sun Mar 20, 2016 7:07 pm

This one is interesting(/usr/var/locks/connections.tdb): expand_file write of 1024 bytes failed (No space left on device)

This file is stored on a ram disk, to prevent disk spin ups, seem the connections database file becomes too big and hangs samba. I remember that we have seen this problem in the past, I forgot what we did to solve it. Later this evening I will do a search in the forum and try to find it in the forum
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Abort due to insufficent resources

Postby wd9895 » Sun Mar 20, 2016 7:22 pm

Yes, these files are on a SSD which is like a Ram-disk and are copied to the NAS. So the files come very quickly ....

With Putty I restart the Samba service by
root@Lacie-NS2:/ # killall smbd
root@Lacie-NS2:/ # smbd

Then the copy process continues for the next minutes ....
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: Abort due to insufficent resources

Postby fvdw » Sun Mar 20, 2016 8:01 pm

I traced down the information and indeed I have had this problem as well when copying more then 50 thousand files
So your problem is confirmed.

The problem is caused by this, when copying files samba writes data in the files
connections.tdb
locking.tdb

which are present in /rw_fs/tmp/usr/var/locks

Especially the locking.tdb file grows, with each file copied since last boot it becomes 100 byte bigger so after about 50 thousand files it reaches a size of 5MB and then the problem occurs and you get the error no space left on device.
This because we have mounted a ramdisk with name tmpfs on /rw_fs/tmp/usr/var with size of 5MB. This is done to prevent unnecessary disk spin ups as samba seem to write to some files in there even when no files are being transferred.
So all files in /rw_fs/tmp/usr/var/ (incl sub folders) cannot become larger the 5 MB.

When the locking and connection.tdb have grown to occupy all the free space of the ramdisk samba will abort. Only after reboot it will work again because then these files are deleted and reset.

I made a new rcS file that will move these two file from the ramdisk to the normal disk, probably it will not affect the disk standby performance as I think that these files are only written to in case there are file transfer made by the samba server (

Attached an adapted rcS file
Replace the one in /etc/init.d by this one (be sure that after replacing it tit still has executable rights)
After installing it reboot your nwsp2 and try again to copy the files...should work now

---edit 25 march 16

file removed, use the patch file to repair this bug

viewtopic.php?f=7&t=2326#p22293
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Abort due to insufficent resources

Postby wd9895 » Mon Mar 21, 2016 10:49 am

Success ! It works.

File attribute of rcS was 755.

Thank you.
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: Abort due to insufficent resources

Postby fvdw » Mon Mar 21, 2016 9:11 pm

:punk

we going to include this in 17-0 release
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Next

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 4 guests