josh4trunks

'setsockopt' Errors In Logs On Freebsd And Freenas

Recommended Posts

I am getting the below errors in the log when starting btsync on FreeBSD and FreeNAS.  I wrote a btsync plugin for FreeNAS and just noticed this when testing advanced options.  It doesn't seem to effect functionality though I presume send and receive buffer sizes aren't being changed accordingly.

[20140112 16:00:45.738] UDP setsockopt(SO_RCVBUF, 2097152) failed: 55[20140112 16:00:45.738] UDP setsockopt(SO_SNDBUF, 2097152) failed: 55

To rule out permissions, virtual environments, and maximum system values, I did the following test.

I ran btsync as root on a host FreeBSD system (not in a jail).  FreeBSD 9.2's default kern.ipc.maxsockbuf is 2097152.  In the config I set 1MB send and receive buffers..

"recv_buf_size" : 1,"send_buf_size" : 1,

A always get the above errors whether or not I..

  • set the send/receive buffers low, high, or don't set them
  • run as root or as an unprivileged user
  • run in a jail or on a host system
Edited by josh4trunks

Share this post


Link to post
Share on other sites

I am running into the same problem here. Receiving the following errors on FreeBSD:

 

UDP setsockopt(SO_RCVBUF, 2097152) failed: 55
UDP setsockopt(SO_SNDBUF, 2097152) failed: 55
 
 
And nothing seem to sync. My config file should be simple enough:
 
{
  "device_name": "my device",
  "listening_port" : myport,                       
 
  "storage_path" : "/folderlog/.sync",
  "check_for_updates" : false,
  "lan_encrypt_data" : true,
  "use_upnp" : false,                             
  "download_limit" : 50,
  "upload_limit" : 50,
  "rate_limit_local_peers" : true,
  "shared_folders" :
  [
    {
      "secret" : "my secret",
      "dir" : "/folder",
      "use_relay_server" : false,
      "use_tracker" : false,
      "use_dht" : false,
      "search_lan" : false,
      "use_sync_trash" : true,
      "known_hosts" : ["my IPs"]
    }
  ]
}
 
 

Any thoughts?

 

Thanks

Share this post


Link to post
Share on other sites

@josh4trunks

 

This error together with error code 55 indicate that OS refused to increase buffer size. It should not affect functionality, might affect performance a little bit.

 

@gmosquera

Do you see your linux box in the devices list on other peers?

Share this post


Link to post
Share on other sites

I see the two boxes with Linux talking to each other just fine (they have read-only key). but the FreeBSD does not find the other boxes, neither the other boxes find the FreeBSD one. The setup is as follows:

 

LAN

|

|--- Linux 1 (RO key) ----------------

|                                                    | Connection ok

|--- Linux 2 (RO key) ----------------

|                                                    X Does not connect

|--- FreeBSD 1 (RW key) -----------

 

No firewalls or any other problem that I can see other than the error I saw on the log:

 

[20140701 08:31:16.254] UDP setsockopt(SO_RCVBUF, 2097152) failed: 55
[20140701 08:31:16.254] UDP setsockopt(SO_SNDBUF, 2097152) failed: 55

Share this post


Link to post
Share on other sites

@gmosquera

 

I see in your config that you disabled LAN discovery, tracker and DHT. Did you add both linux boxes ip:port to FreeBSD and vice versa?

Share this post


Link to post
Share on other sites

Hmmm, ok. This seem to work on the LAN now. Thank you for checking. Now, I have a estrange behavior:

 

LAN

|

|--- Linux 1 (RO key) ----------------                         < ----

|                                                    |                                |

VPN Tunnel                                  |  Connection ok       |                    

|                                                    |                                | > Connection NOT ok

|                                                    |                                |

|--- Linux 2 (RO key) ----------------                                 | 

|                                                    |  Connection ok       |

|--- FreeBSD 1 (RW key) -----------                        < ----

 

Trough the VPN Tunnel, Linux 1 and Linux 2 talk just fine, but FreeBSD does not connect. I know this is more of a FreeBSD issue and Network config, but I want it to put it in here just in case somebody experienced similar issue.

Share this post


Link to post
Share on other sites

@gmosquera

 

Who establishes VPN tunnel? I suspect that it might be "multiple NIC" issue (BTSync has issues when multiple NICs are active).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.