Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-12-11 04:14:58

MikeR
Member
Registered: 2016-09-23
Posts: 50

Catastrophic Complete Backlight Failure

Catastrophic Complete Backlight Failure:

My test site www.michaelregan.co.uk was more or less finished & working great ready to moved over to my main domain in a couple of weeks time.

Making a very small change in a theatre Vegas inline template slideshow (changing the border colour)
& trying to re-publish the 12 photos in it. This happened:

1: Won't publish photo's (or any other photo's from any template)
2: My website will not load at all
3: Can log into backlight but can't access anything at all
4: Lightroom Publishing Manager Check Authentication fails.

The only way I was able to fix this was to delete backlight completely via ftp & reload a backup copy of backlight.

I am then left with this file that will not delete from my server via Filezilla or from my Server Control Panel ftp
backlight/data/designer/master.sq3

All this has happened 3 times trying to republish a gallery or a vegas inline slideshow in the last 2 weeks.

All the above happened using backlight-pages 105 release & 2 Theatre 103

So for my final build, I have used backlight 111 & theatre 104.
I spent 4 solid days completely completely rebuilding my entire website;
every template, gallery set & gallery.
Everthing working fine until the last gallery upload & the same has happened again!!!!!!!!!!!
This was before I had downloaded a backup copy!

So I am back to using the backlight 105 release 2 website.
Can't make any more small changes incase backlight completely crashes again

I think the master.sq3 file is the problem, but don't what to do about it.

Anybody got any ideas please?

Thanks

Offline

#2 2016-12-11 04:21:58

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Catastrophic Complete Backlight Failure

To save some time, I'd suggest sending Ben an email with your Backlight and FTP login credentials along with a reference link to this topic.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2016-12-11 04:40:16

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Thanks Rod have sent Ben an email

Offline

#4 2016-12-11 06:14:01

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, We can only look into issues if we see them.  Since your site has been wiped and reinstalled there's not much we can advise.  Can you provide a URL where we can see the problem?  Also, if you can provide me with FTP access then it will be most helpful in debugging.

It's unlikely that master.sq3 is causing whatever issue you had.  This file was created by the web server, and in your case it looks like it can only be removed by the web server.  Can you try renaming it via FTP?  If you can, then a fresh copy of master.sq3 should be copied over automatically from upon the next page load.  Another option is to try and delete it via your site's Control Panel.

Offline

#5 2016-12-11 15:16:00

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Catastrophic Complete Backlight Failure

Another thing on being unable to remove the master.sql file, it's probably owned by a user other than your FTP user. This often the case with files created on-server by applications, rather than uploaded by FTP. In such cases, you can typically remove the file (or change ownership) by logging in as the root user. Your host, or their knowledgebase, should be able to assist you in exactly how this is done.

If you're on shared hosting, then you may not be able to log in as root, in which case your host should be able to handle the file for you.


Matt

The Turning Gate, http://theturninggate.net

Offline

#6 2016-12-11 16:32:19

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

I have re uploaded my new backlight version 111 website back to www.michaeregan.uk where it came from.
I had download it before deleting it on the web server, thinking it was corrupt, to save any files you might need for debugging

It is now working again with access to backlight admin!
I hope you can debug backlight.
This is the 4th time this has happened.
I have sent Ben an email with ftp & backlight login details

Thanks

I have trying renaming the master.sq file & deleting it via my hosts ftp control panel. It still won't delete so I have submitted a support ticket to my hosts asking them to delete it

Offline

#7 2016-12-11 18:07:41

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, thanks for the FTP details. Is there a URL where we can see the page failing? I can't debug a working site.

Offline

#8 2016-12-11 19:17:18

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Hi Ben. It's working OK now after the re upload.

I could republish all of the 56 galleries again, as that is when it fails.
But when it fails you can not access my website at all, you can login to backlight but not access anything inside it.
I was wondering whether the log files would tell you anything?
Thanks Mike

Offline

#9 2016-12-11 20:22:12

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, I doubt the log files would help.  The best thing would be to look via FTP when the site is in a non-working state.  What I typically do is trace the site code from the start of the index.php file until I find the line that breaks, usually in one of the other files under backlight/.  It's usually caused by a condition on your site or host rather than a bug in our code.  Finding the line that breaks is key to finding the underlying issue.

Backlight captures as many errors as possible, and reports them with a large red message.  Is this something you saw, or did the site leave you with a completely empty page, or something else?

Offline

#10 2016-12-11 20:58:26

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Hi Ben, Backlight didn't report any errors or red messages. The page took ages, didn't load & then said 504 the server took too long to respond.

I'll re-publish all the galleries, as that is when it happened before. With 56 galleries it will take me a long time.
I'll get back to you if it happens again

Thanks Mike

Offline

#11 2016-12-11 21:25:31

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, I wonder if this is an issue with SQLite database performance.  Who are you hosting with? 
Can you provide a link to your Backlight installation?  I tried http://www.michaelregan.co.uk/backlight/ but that doesn't appear to be the location.

Offline

#12 2016-12-11 22:03:58

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Hi Ben, Sorry I gave you my old CE3 site I'm replacing. Backlight is at http://www.michaelregan.uk

I'm hosting with Fasthosts https://www.fasthosts.co.uk/web-hosting
On their Cluster Platform, Linux, Momentum Package

Their default permissions are set 700. I can't change them via ftp.
The only way I could change them is via SSH with PuTTy program which I tried to do once but it was all completely over my head, so I couldn't change them.

Thanks Mike

Offline

#13 2016-12-11 22:36:24

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Hi Ben with regard to file permissions this quote from my support ticket from Fasthosts

"The way the system works is that it will not allow you to change the mode on the files via FTP. It will revert your change to 700 (Linux wise) anyway as the permissions are secured on the backend storage. It's quite complex storage model and the permissions you see in FTP or under Linux may not be relevant."

Offline

#14 2016-12-12 05:17:58

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, it sounds like you won't need to change permissions for normal Backlight installation.  Are you still stuck with a master.sq3 that you can't (and need to?) delete?

Looking at http://www.michaelregan.uk, I can see that the performance is quite slow. By using the link http://www.michaelregan.uk/?skipCache&performance  it shows between 3 and 7 seconds to generate the template.The same test on my own site takes 0.3 seconds. 

Adding ?skipCache forces the page to rebuild the template, so is a worst-case scenario for performance.  However those large numbers suggest the site or host is providing poor performance.  In particular, you can see the lines like "time taken to query", which are database requests, taking hundreds of milliseconds each.

It looks like your SQLite settings are already set to avoid performance bottlenecks, but that doesn't seem to help much, if at all.

Offline

#15 2016-12-12 06:33:45

MikeR
Member
Registered: 2016-09-23
Posts: 50

Re: Catastrophic Complete Backlight Failure

Hi Ben, Thanks for all your effort, great support!
I still can't delete that master.sq3 file, my host said try deleting Filezilla & re install it. That didn't work so I have to phone them tomorrow to try to get them to delete it.

I have re-published all my 56 galleries today, everything worked fine.
With the Vegas inline gallery that caused the failure, I deleted the lightroom template for it & created it again under a new name.
So maybe it was corrupt & that caused the failure. Each failure was caused by republishing a Vegas slideshow.


My backlight site has always seemed slow to load, compared to my old CE3 site @ www.michaelregan.co.uk
I have removed 300 photo's from my CE3 site to my backlight site.
There are still 2500 photographs it it!
I have just recently rebuilt all backlight templates from scratch hoping to improve performance.
The photographs are similar size wise between CE3 & backlight.

So should I complain to my host about poor performance, to see if they can do something, or should I move to a new host.
I would prefer a host here in the UK.

Again thanks for all your help, much appreciated!!

Mike

Offline

#16 2016-12-12 07:05:54

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, Backlight is more database-intensive than CE3.  In CE3 the template design and build process is handled by Lightroom during the export process.  Backlight handles the equivalent process on the server.
 
This in itself shouldn't cause performance issues.  The process is heavily cached so that the template creation (the equivalent of producing the files that the web module's export process did) only occurs once after designs have changed, and are then cached for reuse for subsequent page views.  Even this generation process is one or two orders of magnitude faster than Lightroom's export process.

I would guess that your host wasn't particularly fast with CE3, but with Backlight's additional database usage, that the poor performance is multiplied until it becomes apparent to the user.

In my experience, hosts typically won't take responsibility for performance issues with custom applications.  I'll look to create a simple PHP page that does nothing more than connect to the database, run a simple query (such as fetch all albums details) and report the time taken to run the query.  Assuming that the performance issues are apparent from that simple test, then that can be something to show your host's technical support.  It's hard to argue that the application is an issue when the test page consists of a few lines of code.

Offline

#17 2016-12-12 19:42:18

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Mike, I've emailed you a PHP test file for measuring the performance of a single SQLite query that does not use any Backlight code.

For anybody else interested, the contents of the file is:

<?php
	$start = microtime(true);

	$pdo = new PDO('sqlite:backlight/data/publisher/master.sq3');

	if (isset($_REQUEST['pragma'])) {
		$res = $pdo->query('PRAGMA synchronous = off');
		$pdo->query('PRAGMA journal_mode = PERSIST');
	}

	$queryStart = microtime(true);
	$pdoStatement = $pdo->prepare('select * from album');
	$pdoStatement->execute();
	$results = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);

	$count = count($results);
	$end = microtime(true);
	$queryTime = ($end - $queryStart) * 1000;
	$totalTime = ($end - $start) * 1000;

	echo 'Found '.$count.' albums in '.number_format($queryTime, 3).' milliseconds<br/>';
	echo 'Total time taken: '.number_format($totalTime, 3).' milliseconds';
?>

If uploaded as a file http://yoursite.com/sqlite_performance.php, the time taken to run a query is reported.  A URL such as  http://yoursite.com/sqlite_performance.php?pragma tests with the variables that we have found to improve performance on hosts using network storage.  The results for my own site, with 30 albums is less than 2 milliseconds, whether pragma is set or not.

Offline

#18 2016-12-13 01:04:52

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Catastrophic Complete Backlight Failure

Ben wrote:

Hi Mike, I've emailed you a PHP test file for measuring the performance of a single SQLite query that does not use any Backlight code.

For anybody else interested, the contents of the file is:

<?php
	$start = microtime(true);

	$pdo = new PDO('sqlite:backlight/data/publisher/master.sq3');

	if (isset($_REQUEST['pragma'])) {
		$res = $pdo->query('PRAGMA synchronous = off');
		$pdo->query('PRAGMA journal_mode = PERSIST');
	}

	$queryStart = microtime(true);
	$pdoStatement = $pdo->prepare('select * from album');
	$pdoStatement->execute();
	$results = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);

	$count = count($results);
	$end = microtime(true);
	$queryTime = ($end - $queryStart) * 1000;
	$totalTime = ($end - $start) * 1000;

	echo 'Found '.$count.' albums in '.number_format($queryTime, 3).' milliseconds<br/>';
	echo 'Total time taken: '.number_format($totalTime, 3).' milliseconds';
?>

If uploaded as a file http://yoursite.com/sqlite_performance.php, the time taken to run a query is reported.  A URL such as  http://yoursite.com/sqlite_performance.php?pragma tests with the variables that we have found to improve performance on hosts using network storage.  The results for my own site, with 30 albums is less than 2 milliseconds, whether pragma is set or not.

Apart that you did this for debugging an issue, this is really cool. I was wondering in the past if the performance flag would benefit me, but never tried it. With 65 albums, it went from 4.3ms down to 2.2ms (I'm on Bluehost). So definitely something I should enable. Thank you for sharing!


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#19 2016-12-13 06:00:49

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Catastrophic Complete Backlight Failure

Hi Daniel, I'm glad that was helpful. The main point of that script is to highlight any performance issues with Backlight taken out of the equation.
For some real numbers, it's worth adding ?skipCache&performance to the end of one of your site URLs. This adds a bunch of performance figures to the page, and does the full work of generating the template. Look for the figure 'time taken to generate template' or similar for the full page generation time. The log statements may be hard to read, depending on your page design. Selecting the full text or viewing the page source can help.

Offline

#20 2016-12-13 06:09:27

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Catastrophic Complete Backlight Failure

Thank you, Ben!


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

Board footer

Powered by FluxBB