The socket is detached immediately after sending the pdf to the connection via:
ns_writer submitfile $path
After that it continues deleting some temporary files and then aborts without any further ns_return.
The error in the log is somewhat confusing, but what worried me was the occasional malfunction of trml2pdf.
Thank you again,
Claudio