Error uploading files

Hi there, I am getting a lot of “upload errors” while using the browser uploader. When I try to upload like 400 (500KB files) uploads at the same time the error appears. When I try smaller bulks all is succesfull.

What to do?

You may be hitting some server limit or security settings. If you’re familiar with the browser’s network inspector then can you have a look at the error code and any message returned from the server?

Thx Ben, ill try to get it monitored. Pain is gone for some reason, so ill try to reproduce and capture the network settings when the error occurs!

Hi Ben,
error is back again.

uppy.js:1

   POST https://www.circuitpics.nl/webshop/backlight/publisher/ajax_add_photos/516862/ 503 (Service Unavailable)

(anonymous) @ uppy.js:1
t._call @ uppy.js:1
t._next @ uppy.js:1
(anonymous) @ uppy.js:1
Promise.then
t._queueNext @ uppy.js:1
done @ uppy.js:1
(anonymous) @ uppy.js:1Understand this error
uppy.js:1 SyntaxError: Unexpected token ‘<’, "
<b"… is not valid JSON
at JSON.parse ()
at Object.getResponseData (uppy.js:1:240042)
at XMLHttpRequest. (uppy.js:1:243157)

Hi @Phoentje, is that the same error?

Can you look at the network inspector to see what the server is returning when trying to upload an image?

Hi @Ben , anything odd here?

Sorry, @Phoentje I meant to reply again.
The 503 errors aren’t normal. Can you click on one of those and see what content the server is returning?

Hi @Ben ,

sorry for late answer, been a while since I used the upload. New season so new files going online for me.

Getting those 503s again…

Hi @Ben any update on this one? Still struggling with file uploads…

Hi @Phoentje, sorry that I didn’t see your comment from April. Something isn’t right with your hosting. As the error message shows, 503 Service Unavailable means that the server itself isn’t responding.
Who are you hosting with? Have you asked your host’s technical support about this?

@Ben o problemo, I can upload them in small batches (30 at a time) and then all goes well… When I do bulk like 300 files I jump into these errors. So 100% hosting issues?

@Phoentje very likely yes. It’s not characteristic of something in Backlight itself.

This kind of error has come up from hosts that implement mod_security. That’s a security layer that protects the server from a variety of security risks, whether real or perceived. Rapid file uploading could be be deemed a security risk.

Are you uploading from Lightroom or directly in Backlight? If the former then we have a setting to slow down requests in order to not trigger security protections like this.

Hi @Ben I upload using the backend forms. So we could trigger a delay?

If using Lightroom to upload albums.

Ohhh, bugger. I found uploading and managing trough Lightroom was too slow. So I used the web version.

Hi @Phoentje, we use a Javascript library called Uppy for uploading from Backlight. It doesn’t seem to provide a way to add a delay between requests.

The add photos page configures Uppy to send two images at a time. You may have some luck in changing this to only one. To do that, you’d need to edit the file on your server at backlight/modules/module-publisher/application/views/admin/add_photos.php. Look for the line with limit: 2, and change it to limit: 1,.

If you do try that, let us know whether it helps. If it does, I would add an option into Backlight’s settings.

Lightroom’s publishing can be sped up with the Publisher setting “Publish Master Renditions from Lightroom”. That causes the LR plugin to only send a single rendition for each photo to Backlight, instead of one for each rendition type (e.g. photos, thumbnails, photos-for-download, photos-for-purchase)… these renditions are instead created on the server, in the same way they’re created when uploading directly from Backlight.

Another option is that you work with your host to resolve the 503 errors on uploading…

Hi @Ben ,

what I see in the files =

var endpoint='<?php echo URLHelper::url('../publisher/admin/ajax_add_photos/'.$album->getId()); ?>'; var uppyOptions = { limit: 1, // No concurrent uploads debug: true, autoProceed: false, restrictions: { maxFileSize: <?php echo $maxPostSize; ?>, maxNumberOfFiles: <?php echo $maxFiles; ?>, minNumberOfFiles: null, allowedFileTypes: ['.jpg', '.jpeg'] and this part var xhrOptions = { bundle: false, endpoint: endpoint, fieldName: 'file', limit: 2, timeout: 120000, headers: { 'X-Requested-With': 'XMLHttpRequest' so i guess its already set.?