Hello,
I am having a rather annoying problem with my Kanboard.
When I try to upload files bigger than 130kb the Upload will get stuck at 100%, no more progress even after waiting up to 20 minutes. I don’t receive the notice that everything has been uploaded.
Information on my Setup:
Hosted VM with 2GB RAM; 1 Core; 100GB drive.
Server: Ubuntu-Server 18.04 with Apache2
I edited the php.config in both php/apache2 and php/cli to be safe.
upload_max_filesize = 256M
post_max_size = 512M
max_file_uploads = 10
I also installed the following Plugins:
- Customizer
- MarkdownPlus
- Auto Email Extended Actions
I activated the URL-Rewrite.
I used Firefox and Opera on both Linux(Ubuntu 16.04) and Windows 10 to access my Kanboard
I used my administrative account to upload files (or tried to upload)
Now to what I already tried:
- Checked the Apache2 Error log - nothing but my restart notifications
- Checked the debug.log, but wasn’t able to Identify anything. I tried to upload from 7:35 to 7:37 and from 8:18 - end of log.
- Disabled URL-Rewrite
- Used several files, ranging from 140kb to 800mb (all above 256mb is marked as to big)
- Changed to another User
- Restarted the whole VM serveral times
- Checked that my kanboard/data folder and below belongs to www-data
I am really running out of ideas. If you need more input, feel free to ask.
PS: The pastebin to my debug log will be accessible for 6 Months starting today.
When I try to upload files bigger than 130kb the Upload will get stuck at 100%, no more progress even after waiting up to 20 minutes. I don’t receive the notice that everything has been uploaded.
One thing I’m not clear about: do the files actually get saved? Some things to check:
- Permissions on the PHP’s upload_tmp_dir (defaults to your system’s temporary folder if not set)
- This is unlikely, but you could use your web browser’s developer console to see if there are any javascript errors during the upload. If the files are actually being saved, maybe there’s a bad script that’s causing the upload status to not change.
EDIT: Also, try removing all your plugins. If it works without plugins, add one plugin at a time to determine the culprit.
Hello and thanks for the quick response.
No the files won’t be saved, I even went to the data folder /files/thumbnails/tasks
to check which tasks have attachements.
Regarding the permission of the tmp folder drwxrwxrwt 10 root root 4096 Mär 3 16:39 tmp
I also tried to deactivate all plugins but and watch the dev-console:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data - app.min.js:38:1672
onreadystatechange https://kanboard.example.net/assets/js/app.min.js?1576454976:38
Had a look on the source-code behind it - I was not able to see any obvious error, but I’m also not a web-developer.
request.onerror=function(){errorCallback()};request.onreadystatechange=function(){if(request.readyState===XMLHttpRequest.DONE){var response=parseResponse(request);switch(request.status){case 200:successCallback(response);return;case 401:authErrorCallback(response);errorCallback(response);break;case 0:netErrorCallback(response);errorCallback(response);break;default:errorCallback(response);break}}};request.send(body);return this};this.success=function(callback){successCallback=callback;return this};this.authError=function(callback){authErrorCallback=callback;return this};this.netError=function(callback){netErrorCallback=callback;return this};this.error=function(callback){errorCallback=callback;return this}};KB.http.get=function(url){return(new KB.http.request('GET',url)).execute()};KB.http.postJson=function(url,body){var headers={'Content-Type':'application/json','Accept':'application/json'};return(new KB.http.request('POST',url,headers,JSON.stringify(body))).execute()};KB.http.postForm=function(url,formElement){var formData=new FormData(formElement);return(new KB.http.request('POST',url,{},formData)).execute()};KB.http.uploadFile=function(url,file,csrf,onProgress,onComplete,onError,onServerError){var fd=new FormData();fd.append('files[]',file);fd.append('csrf_token',csrf);var xhr=new XMLHttpRequest();xhr.upload.addEventListener('progress',onProgress);xhr.upload.addEventListener('error',onError);xhr.open('POST',url,!0);xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');xhr.onreadystatechange=function(){if(xhr.readyState===XMLHttpRequest.DONE){if(xhr.status===200){onComplete()}else if(typeof onServerError!=='undefined'){onServerError(JSON.parse(xhr.responseText))}}};xhr.send(fd)};(function(){var isOpen=!1;function onOverlayClick(e){if(e.target.matches('#modal-overlay')){e.stopPropagation();e.preventDefault();destroy()}}
Thats pretty much the outcome. Any more ideas on what I could try?
I don’t have any solid ideas, no. I haven’t run into this problem in my own installs of Kanboard, but I did find that I had issues with newlines in my config.php. Make sure there’s no blank lines at the beginning or end of Kanboard’s config.php (this is probably unrelated to your problem).
Like you, I’m not a web developer, but if you want to dive more deeply into it, you could set up Firefox to break on exception and maybe examine why JSON.parse fails. The breaking-on-exception setup is documented at https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Breaking_on_exceptions
I hope this helps!
Hello again!
I was able to narrow down my problem. Now I only have to find the actual source.
Simply put, I didn’t try to upload through my local network - that actually works but is also extremly slow in loading any elements. So I thought it had something to do with my reverseproxy.
Thankfully I still have my config for my Reverseproxy and Kanboard on my Pastebin.
Here is something from my NGINX (Reverseproxy) log:
*586 client intended to send too large body: 48740960 bytes, client:
*537 connect() failed (113: No route to host) while connecting to upstream, client:
*537 connect() failed (111: Connection refused) while connecting to upstream, client:
After reading that I increased the max_body_size of Nginx, I don’t see any new errors in the log when trying to upload but I’am still not able to upload anything bigger than 130kb.
I also tried to setup a new Kanboard-Server, thats how I was able to narrow it down.
I now believe it is a Problem with my revereproxy server but I don’t see the problem. Not getting any errors in the debug.log, error.log of apache2 and error.log of nginx is for once not good.
Sorry for not including my reverseproxy before but I was sure it was something I misconfigured on my kanboard.
Slow and steady wins the race right? I’m gratefull for any help or pushes in the right direction.
Sorry, I don’t use Nginx with Kanboard, just Apache. Does a default Kanboard installation work okay if you run it with PHP’s built-in webserver? (https://docs.kanboard.org/en/latest/admin_guide/faq.html?highlight=built#how-to-test-kanboard-with-the-php-built-in-web-server)
I maybe made this a bit confusing.
My Kanboard is running with Apache2 and php.
When accessed through my local-Network I have problems with loading speed, but I am able to upload files up to 256MB (like intended).
When I access my Kanboard through the Internet, a Reverseproxy will handle the traffic. The Reverseproxy is using Nginx.
Right now I tried to open another Port to directly connect to my Kanboard.
Same behaviour as the local connection - Slow in loading but uploads work just fine.
EDIT SOLUTION FOUND
After a lot of Research in found this very website from Apache which was the solution so me.
Because the connection between Reverseproxy and Kanboard is encrypted the buffer size for said connection has been exceeded. I bumped it up quite a bit. Doesnt feel good to bump this up, so I’ll look into it a bit more.
TL:DR; Increased the buffersize of my SSL connection on my Kanboard.
I’m glad you got it working! I would never have thought to look at that Apache SSLRenegBufferSize option.