Forum OpenACS Development: File Storage 2.2 GB Upload error

Collapse
Posted by Raul Rodriguez on
Uploaded a 2.2 GB to File Storage and got the error below. Any ideas how to resolve?
openacs 5.9.1
NaviServer 4.99.21

Thank you

^[[0;32m[11/Jul/2023:19:57:43][2882.7fbff574b700][-conn:mothercabrini:default:0:87-] ^[[0m^[[1;31mError: rp_handler no-script-abort: errorMsg expected integer in range [0,2165334988] for 'length', \
but got -2129632867 while serving POST /downloads/file-add HTTP/1.1
:    \x09ad_url </downloads/file-add> maps to file </var/www/mothercabrini/packages/file-storage/www/file-add.adp>
:    NONE
:    expected integer in range [0,2165334988] for 'length', but got -2129632867
:        while executing
:    "ns_conn copy $off $len $fp"
:        (procedure "ns_getform" line 47)
:        invoked from within
:    "ns_getform"
:        (procedure "::nsf::procs::ad_page_contract" line 307)
:        invoked from within
:    "ad_page_contract {
:        page to add a new file to the system
:
:        @author Kevin Scaldeferri (mailto:kevin@arsdigita.com)
:        @creation-date 6 Nov 2000
:        @cv..."
:        ("uplevel" body line 2)
:        invoked from within
:    "uplevel {
:        ad_page_contract {
:        page to add a new file to the system
:
:        @author Kevin Scaldeferri (mailto:kevin@arsdigita.com)
:        @creation-date 6 No..."
:        (procedure "code::tcl::/var/www/mothercabrini//packages/file-storage/www..." line 2)
:        invoked from within

Collapse
Posted by Gustaf Neumann on
In order to get so far, you have removed 2 safety belts, namely increased the "maxinput" parameter in the NaviServer configuration file (often controlled in configuration files via "max_file_upload_mb") and the package parameter "MaximumFileSize" for the OpenACS file storage package.

The short answer is: you are running into a limit of Tcl 8.

Tcl 8 has a limitation that every Tcl_Obj (and many more other interfaces structures) are limited to hold max 2 GB of data (signed 32bit integers). One is allowed to have an unlimited number of these Tcl_Objs. NaviServer protects in this case via the range check the user from other crashes in Tcl, which are much harder to debug. When, e.g., removing the range check in NaviServer, Tcl will crash hard in Tcl_Write(). Even, when the data is successfully read received via NaviServer, Tcl will crash in the decoding of the POST data, where the file-based MIME parser is written in Tcl.

The 32bit limit of Tcl will be lifted with Tcl9, when it comes out. You might want to join the OpenACS conference, where the steps leading to the release of Tcl9 and the blockers will be discussed.