Project build errors when on (NAS) network share

There some topics in these fora about build errors when the project is located at a network share.
I've succeeded to get similair errors when building a sample (Android) project named 'MyFirstProgram'

The network share is located at my Synolgy DS920 NAS, its based on Linux which is quite important.

Please let me explain the theory behind a network share. The protocol used between the client (Windows desktop) and server which is responsible for the network sharing of files/directories and printers is base on the SMB (Server Message Block) protocol.

Reference: https://en.wikipedia.org/wiki/Server_Message_Block

Windows from its earliest days had it build in (LanManager 1.x), later on the layered product called SAMBA was available at Linux/Unix systems. The SMB protocol was documented in various documents over time.

So looking at my Synolgy NAS it has a rather old version of the SAMBA daemon installed, version V4.10.18. The latetst stable release is V4.16.2.
Although the NAS server has all the updates!

Most NAS servers are not keeping the SAMBA server to the latest version.

Anyway, back to my example project and the error I got during the build.
At a local disk the build of the example project 'MyFirstProgram'was successfully, no problems at all.
When I copied the same project to a network share at my Synolgy NAS the build failed with error:

B4A Version: 11.80
Parsing code. (0.00s)
Java Version: 11
Building folders structure. (0.31s)
Compiling code. (0.14s)
Compiling layouts code. (0.06s)
Organizing libraries. (0.01s)
(AndroidX SDK)
Compiling resources (0.20s)
Linking resources (0.55s)
Compiling debugger engine code. (1.75s)
Compiling generated Java code. (2.34s)
Finding libraries that need to be dexed. (0.01s)
Dex code Error
Error in flag file argument: '@d8_arguments.txt':
File not found: d8_arguments.txt

Compilation failed

I made a network trace between the Windows desktop and the NAS SAMBA server (port: 445) to watch the SMB traffic.
From the network trace I noticed that there was a violation of the SMB protocol, in this case the Windows long name 'MyFirstProgram' got translated to the short name 'MCU505~H' which is correct but the SAMBA server didn't understand this, which is faulty, and responded with the error "STATUS_FILE_IS_A_DIRECORY'.

At that moment all files and the network connection was closed between the Windows Desktop and the SAMBA server at the NAS.

So the error which was displayed 'File not found: d8_arguments.txt' is a kind of misleading.

Conclusion : This is a bug in the SAMBA server at the NAS server.
Should it work? : Yes, it should. I've created a virtual machine with SAMBA version V13.17 and it builds as expected.
Workaround : In my case I renamed the top directoy 'MyFirstProgram' to a shorter name like “Programs”. This works for me but it is not a guaranty that it works in all cases.
It all depends what kind of error occurs and the only way to found out is to make a network trace like I did.

It's hard to upgrade the SAMBA version if the upgrade of your NAS isn't updating the SAMBA server to the latest version.

Regards,
Rob
 

bobbruns

Member
Licensed User
Longtime User
I have the same server, and the same problem. I moved all the files to a windows based share and now use it exclusively. I can share files on my network fine, but the Synology server seems to be off limits for shared files. BTW iOS files seem to work fine, only Android chokes on Synology.
 

GiuliaReis

New Member
My Synology NAS server has updated the Samba server, smb and nmb client.
smbd version 4.10.18

Unfortunately this did not fix the problem. I'm thinking about upgrading the Samba stuff on my own.
 
Top