What's new

smbd_accept_connection: sys_fork() failed: Cannot allocate memory

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Marko Polo

Senior Member
When using this rsync command

Code:
rsync -r --progress --inplace --rsh='ssh -p29' adm@192.168.1.1:/mnt/data/backup/folder /media/BACKUP/folder

I get this error in log:

Code:
Jul 27 15:48:37 smbd[698]: [2018/07/27 15:48:37.403236,  0] smbd/server.c:572(smbd_accept_connection)
Jul 27 15:48:37 smbd[698]:   smbd_accept_connection: sys_fork() failed: Cannot allocate memory

Moreover, ssh connections are not working (router does not accept it) and I see:

Code:
ssh_exchange_identification: read: Connection reset

On the router side:

Code:
Jul 27 15:41:50 dropbear[5903]: Error forking: Cannot allocate memory

What's the matter? Why there is a shortage of RAM here?
 
Last edited:
How many files are you trying to sync? I remember having a similar problem with rsync on another platform. When there was thousands of files it would run out of memory trying to create the hashes.
 
Bump! Merlin, maybe you say smth? Seems to be a bug in firmware

No, you are simply running out of RAM to run the operation:

Code:
smbd_accept_connection: sys_fork() failed: Cannot allocate memory
 
So why simple rsync causes this RAM shortage? This is not huge amount of data.
Moreover, the rsync command is started on remote PC side, not on router.
 
A quick Google search on "rsync memory usage" seems to indicate that it can use a fair amount of memory on a regular 4 GB system. I doubt the authors ever considered running it on a device with less than 500 MB of free RAM to handle 56 GB of data.
 
I also read this.
But shouldn't be rsync using memory of caller's system (where command was initiated) presumably? On the source system (=router) it should be using only SSD caches, no? I run it NOT in daemon mode.
 
Last edited:
I also read this.
But shouldn't be rsync using memory of caller's system (where command was initiated) presumably? On the source system (=router) it should be using only SSD caches, no? I run in NOT in daemon mode.

Depends on how buffering is implemented. The router also has to allocate a fair amount of RAM to the local write buffers, so it might be a racing condition as to who can deplete the available RAM first.
 
Hello, I am experiencing a similar issue on a RT-AC68U with 386.3_2.

I run rclone (similar to rsync) once a week with about 30GB of data. After running this (it takes about 48 hours and has no errors) everything seems okay for a few days, but then I start getting:

Dec 8 17:04:55 dropbear[906]: Error forking: Cannot allocate memory
Dec 8 17:04:55 dnsmasq[830]: script process exited with status 16

At this point the router continues to work fine as a router, but the web UI rejects connections (ERR_CONNECTION_REFUSED) and SSH just times out.

The only option once it gets in this state is to physically turn the router off and back on, at which point it's fine again.

My router has very minimal setup (no uPNP or QoS or traffic analyzer etc.), most features are disabled and HW acceleration is enabled.

I'm not sure what to do here as the only 'solution' seems to be to reboot my router once a week after rclone runs, but that seems kind of extreme and hopefully unecessary.

The very odd thing is this exact same rclone sync (with the same amount of data) worked for 3 months without the router ever needing to be rebooted. Then a few weeks ago I had to restart the router for an unrelated reason, and ever since then this issue has been occurring.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top