File Upload Disconnected. Please try again

+1 even with latest versions as soon as one tries to setup a company and tries to upload a letterhead.

$ bench version
civil_contracting 1.5.0
erpnext 10.0.5
frappe 10.0.6
$ bench --version
4.1.0

Hello @rmehta,

I checked the Procfile.

Please what does this line do?
socketio: /usr/bin/node apps/frappe/socketio.js

The folder /node apps/ does not exist in my /usr/bin folder. Do i just point it to any socketio client js library?

Thank you.

same error, we change to Firefox and upload files ok!

Hi,

I also had the same issue of “file upload disconnected. please try again”. after some try over and again i got one simple solution to this problem which helped me. you also can try may it help you " please check your file size and try uploading small size file you can try with size like 15 to 50KB of size and then upload" hope it help to get the answer to this issue.
Thanks.

it works for small size you can try with file GIF (Bitmap)~16.7 KB

1 Like

~/apps/erpnext/htdocs/frappe-bench/sites/assets/js$ vi desk.min.js
Step1: chunk_size = _ref$chunk_size === undefined ? 24576 : _ref$chunk_size, Line no:2078
Increase as you required like
chunk_size = _ref$chunk_size === undefined ? 2457600 : _ref$chunk_size,
Step2:- var file_not_big_enough = fileobj.size <= 24576; Line no: 8993
Increase as you required Like
var file_not_big_enough = fileobj.size <= 2457600;

1 Like

I had the same problem and based on the feedback on this thread. The issue manifests itself with large size attachments. I tried to change the chunk_size as well as the file_not_big_enough, but as soon as I restart the bench, the file desk.min.js gets repopulated with the original file and thus the increase in file size does not show or work.

I decided to run a bench switch-to-master , it is the latest installation. after that bench asked me to run --upgrade and that failed: Now if try to do bench-start, I’m getting this and the system is in a crashed state:

Updating node packages...
INFO:bench.utils:npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN frappe@ No description
Backing up sites...
Patching sites...
Migrating site1.local
Updating DocTypes for frappe        : [                                        ]Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)

We have the same problem here. We used GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext and IPv6 address ip like http://[::1]:8000/ and we were able to upload files. If we use IPv4 address ip it does not work. Someone found the reason of this problem? It really cause headache.

@johnskywalker @rmehta

slice = _this.file.slice(place, place + Math.min(_this.chunk_size, _this.file.size - place));
Uncaught TypeError: Cannot ready property ‘slice’ of null

I am also getting the ‘file upload disconnected’ error using either localhost or 127.0.0.1 for larger files. If I dramatically increase the chunk size in socketio.js then larger files work but I still get the ‘file upload disconnected’ error so perhaps the error is unrelated to the upload failure?

1 Like

I have this problem too.

I was able to solve this problem by just log out and login again :slight_smile:

File Upload Disconnected. Please try again. me to same problem can anyone suggest me

same problem for me can i know solution

This worked for me in a new install of v12 - specifically adding the sitename (ex site1.local) in /etc/hosts on the ERPNext server and calling that sitename from the browser (ie http://site1.local:8000)

here’s what the entry in hosts looks like on the server
127.0.0.1 site1.local

here’s what the hosts file entry looks like on the client (browser side)
192.168.0.223 site1.local

In my case, I had to chmod 777 to /public/files folder.

I fixed my issue ussing a server name.

mysite.local.

it doesn’t work with localhost:8000 or 127.0.0.1:8000

2 Likes

Same exact issue. This is unusable.

ERPNext: v11.1.18 (master)

Frappe Framework: v11.1.18 (master)

Hello - how did you get the name to resolve without opening to internet

thanks

You may edit your hosts file,

On mac or linux you can open with the following command:

sudo vim /etc/hosts

(If you don’t have vim you may open with another text editor)

An add an line like:

127.0.0.1 mysite.local 

So you can open http://mysite.local:8000

Just interested to know that it does not have any side effects after modifications
Will it work for all bench instances?

Thank you.