Help! I'm getting error on several PHP pages that use CouchCMS:
Why might this be happening, and what might I do to resolve the issue?
=====
DETAILS (warning: long)
- The website is PHP-based. It is served by Nginx, behind Varnish cache. (My Varnish process is configured to only serve cached pages to users without any cookies.)
- The site is actually multiple sub-sites, living on a single subdomain:
http://www.example.com/Site1
http://www.example.com/Site2
http://www.example.com/Site3
- Each sub-site has *its own individual CouchCMS installation*, like this:
http://www.example.com/Site1/couch
http://www.example.com/Site2/couch
http://www.example.com/Site3/couch
(I.e., there is no "master" CouchCMS that controls all of the sub-sites.)
- Each individual CouchCMS has its own separate database, e.g.:
Site1 has a database named 'site1' for its Couch data
Site2 has a database named 'site2' for its Couch data
Site3 has a database named 'site3' for its Couch data
- Our publishing workflow requires that edits be made to a "staging" environment, prior to being 'published' to "production". So really, every site has two instances, like this:
http://staging.example.com/Site1 <~ "staging" (CMS edits are made here)
http://www.example.com/Site1 <~ "production" ('site1' database is "pushed" to this server.)
To publish changes, here is what we do: An editor goes to http://staging.example.com/Site1/couch. She makes text changes. She then runs a "publish.php" script, which copies the respective database ('site1') over to http://www.example.com. "Staging" and "production" are two different cloud servers, but they have been built identically: They always have the exact same code for the site. They have the exact same PHP versions. They have the exact same Nginx versions and configurations. They have the exact same ionCube Loaders.
I have never seen this issue on my local machine. I have only seen it on the "production" machine. And it seems to happen *intermittently*.
I can't find anything reference in any of the Couch database tables that may cause this issue.
The only thing that might seem to be related is this line, in couch/config.php:
I've set it to 'http://www.example.com/Site1', but that didn't seem to do anything -- the error still continued to appear intermittently as before.
The only two reasons for this error that I can think of are:
- ??? Varnish cache is somehow interfering with CouchCMS. (But that seems unlikely.)
- ??? There is a hidden configuration in CouchCMS somewhere that references the site's absolute path, and the fact that we "publish" from a "staging" server to a "production" server means that the reference is wrong.
'couch' folder should reside in the main web-site folder
Why might this be happening, and what might I do to resolve the issue?
=====
DETAILS (warning: long)
- The website is PHP-based. It is served by Nginx, behind Varnish cache. (My Varnish process is configured to only serve cached pages to users without any cookies.)
- The site is actually multiple sub-sites, living on a single subdomain:
http://www.example.com/Site1
http://www.example.com/Site2
http://www.example.com/Site3
- Each sub-site has *its own individual CouchCMS installation*, like this:
http://www.example.com/Site1/couch
http://www.example.com/Site2/couch
http://www.example.com/Site3/couch
(I.e., there is no "master" CouchCMS that controls all of the sub-sites.)
- Each individual CouchCMS has its own separate database, e.g.:
Site1 has a database named 'site1' for its Couch data
Site2 has a database named 'site2' for its Couch data
Site3 has a database named 'site3' for its Couch data
- Our publishing workflow requires that edits be made to a "staging" environment, prior to being 'published' to "production". So really, every site has two instances, like this:
http://staging.example.com/Site1 <~ "staging" (CMS edits are made here)
http://www.example.com/Site1 <~ "production" ('site1' database is "pushed" to this server.)
To publish changes, here is what we do: An editor goes to http://staging.example.com/Site1/couch. She makes text changes. She then runs a "publish.php" script, which copies the respective database ('site1') over to http://www.example.com. "Staging" and "production" are two different cloud servers, but they have been built identically: They always have the exact same code for the site. They have the exact same PHP versions. They have the exact same Nginx versions and configurations. They have the exact same ionCube Loaders.
I have never seen this issue on my local machine. I have only seen it on the "production" machine. And it seems to happen *intermittently*.
I can't find anything reference in any of the Couch database tables that may cause this issue.
The only thing that might seem to be related is this line, in couch/config.php:
- Code: Select all
//define( 'K_SITE_URL', ...
I've set it to 'http://www.example.com/Site1', but that didn't seem to do anything -- the error still continued to appear intermittently as before.
The only two reasons for this error that I can think of are:
- ??? Varnish cache is somehow interfering with CouchCMS. (But that seems unlikely.)
- ??? There is a hidden configuration in CouchCMS somewhere that references the site's absolute path, and the fact that we "publish" from a "staging" server to a "production" server means that the reference is wrong.