Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi all,

I'm having a weird issue: I am getting random 'masterpage not found' errors in my prod website without even editing any file :/
I have a dev environment folder right inside the root which I suspect is what's causing this issue. I was making some changes there and when I refresh my live site, it gives me a "Masterpage 'site.php' not found" error. Then after trying to figure out what's happening (I might have accessed 'site.php' directly) it just fixed itself, but all the data was gone :o .
Does it have to do anything with that? Both projects use separate couch folders and connect to different databases.

Thanks,
Olsi
Could you please post the folder structure showing how the two sites are related to each other?
Show also specifically where the site.php template is located.
Hi KK,

This is the structure:

| -- couch/
| -- index.php
| -- site.php
| -- dev/
| -- -- couch/
| -- -- index.php (this is another page)
| -- -- site/
| -- -- -- index.php (here I embed 'site.php' from snippets/)
| -- -- snippets/
| -- -- -- site.php

Inside 'dev' I have another structure (contents of site.php are not in the homepage anymore), but the template names and fields are the same.
Thanks.

Frankly, I cannot see why the arrangement would cause any conflict.
Can you grant me access to your site please? Allow me to take a look at the problem.
Thanks for the creds. The password happens to be incorrect though so I was not able to connect.
Anyway, something you mentioned in the PM would explain the problem and we don't need to dig any further -
OK, tiny detail update... Both projects are actually connecting to the same database :?

If that is the case, then anytime you access the nested 'dev' site, it will overwrite the main site's data and anytime you access the main site it will overwrite the 'dev' site's data. This, I think, is precisely what you have been experiencing.

The correct way of making multiple Couch installations share the same database is to allocate separate sets of tables for each in the same database. To do that, following is the setting in the config file -
// 7b.
// Needed only if multiple instances of this CMS are to be installed in the same database
// (please use only alphanumeric characters, hyphen or underscore)
define( 'K_DB_TABLES_PREFIX', '' );

So, for example in your case, the main site can do without having to set the above directive.
The config of the nested 'dev' site can have the following -
// 7b.
// Needed only if multiple instances of this CMS are to be installed in the same database
// (please use only alphanumeric characters, hyphen or underscore)
define( 'K_DB_TABLES_PREFIX', 'dev_' );

Hope it helps.
Got it, thanks! :D

Yeah I understand how that would be a problem, I thought they were using different databases. Apparently I may have messed up when uploading the config file :oops:
6 posts Page 1 of 1