Jump to content

Configuring Datastore to write access corrupts test forum


FFOC

Recommended Posts

I have finally got my test install working sort of, after hours of trying to figure out why. However, it is returning some issues, I don't have some of the symbols on the test forum or AdminCP like these pictured:

 

image.png.4cf35a76a99f6d3521edb2ad70da5d74.png

image.png.5520401c000850ea08b8c3f3963b0c79.png

Images like avatars etc are all fine. I also have an error about Data Storage, it said a few directories were not CHMOD 0777, so I changed them. These were Applications, Upload/Logs, Datastore and another I think. These all appeared to be fine with the exception of the datastore one, my admincp and forum test pages both go all garbled as soon as this one is done. If I restore the datastore files from my live forum it returns back to the above.

I am trying to have it so I can upgrade this and check it is fine, like you should, before I mess with the actual live website. My learning curve is vast, but being an engineer by trade, I am a quick learner., especially when I understand what certain things do.

This is the warning now in AdminCP:

image.png.05e2d4f4164ded0b95bc5f176745ddf6.png

image.png.56e0fb7af7f794d4e62c536b4a081767.png

 

The setting here are the same as my live site, with the exception of the /testing.ffoc.co.uk

 

Does anyone know what is going wrong? If I ignore this and go to upgrade, download the files manually and install them, overwriting where prompted like it asks, the system check comes back everything is fine, I enter my login details on the upgrade screen, then it all goes down again. The only way I can recover it is if I write over the new upgrade files with the old ones again but then I am back to square 1.

Link to comment
Share on other sites

Does that directory, that exact path, actually exist?

7 minutes ago, FFOC said:

If I restore the datastore files from my live forum

You shouldn't really be restoring anything into the datastore folder. It's created on the fly, and is specific to the site being accessed. www.domain.com and test.domain.com would have different datastore content.

Link to comment
Share on other sites

1 minute ago, Nathan Explosion said:

Does that directory, that exact path, actually exist?

You shouldn't really be restoring anything into the datastore folder. It's created on the fly, and is specific to the site being accessed. www.domain.com and test.domain.com would have different datastore content.

For the first question, yes.

For the second, I copied my website/forum files as it describes in the moving server guide:

I followed what it said regarding changing the values in the conf_global file to point at the new database (Copied data again) and the test site.

I can now run the test site, but these errors are appearing. It is pretty much a replica of my live site, up to the point of backing it up that is, as I wanted to check everything was fine and thought that was the best way if all the data was on it too.

I know I am missing something I haven't done, but not sure what exactly.

Link to comment
Share on other sites

18 minutes ago, Nathan Explosion said:

Those 'errors' are icons from font-awesome....you are going to have to provide a link to your sites for anyone to help you, I think. A screenshot only presents a picture....a link gives the full picture.

I have just had to re-upload the original copied files.

My live site is http://www.ffoc.co.uk

My test one is www.testing.ffoc.co.uk

Other than a couple of extra recent posts on the live one, they should be identical. The only difference between them should be the domain, and the database details, but I get the errors shown above on the test one. The test one isn't yet behind a password, but will be once this is sorted to prevent users accessing it other than myself and other admins to test bits in the future before migrating them to the live site.

 

Edited by FFOC
Fixed links
Link to comment
Share on other sites

Could it be a DB issue? I ask as since reuploading the copied files it has failed again, however before it did, the datastore warning didn't appear in the AdminCP this time, I went through the support to click 'something isn't working' and it said i had errors in the DB, although again, this is a exported dump from the original live one.

 

It said these earlier too and it went 'corrupt' when i tried to fix them, same as when i tried to fix the datastore bit.

Link to comment
Share on other sites

Further, even though my AdminCP (And the site) screen looks like this:

image.png.36a2cc9bbd45501fb277f66dbe4454db.png

I can still try things. The upgrade, is the Invision software which I am trying to get to do, lol. The recommended changes are to do with Curl. The DB ones, if I click fix this, then scroll down to the bottom of the page, it says this:

There are some problems with your database. Normally it is safe to try to fix these problems automatically however if your community is large, you may want to run the necessary queries manually. If so, the queries to run are:

UPDATE `ffoc_core_output_cache` SET `cache_expire`=0 WHERE `cache_expire` IS NULL;
ALTER TABLE `ffoc_core_output_cache` CHANGE COLUMN `cache_expire` `cache_expire` INT (10) NOT NULL DEFAULT 0 COMMENT 'Unix timestamp of when the cache expires';

 

I have ran this and both come back with :

image.png.7c94838248f6957b6d7eac20205c1da0.png

So not sure what that means if the results are zero.

Edited by FFOC
Link to comment
Share on other sites

2 hours ago, bfarber said:

Are your folders writable on the test installation? i.e. the /datastore folder and the /uploads folder (and all files and folders underneath both)? If not, that would likely explain the issue you're running into.

Hi bfarber,

 

Yes they were. It highlighted this straight away. When I changed them to 0777 was when my issues started, other than the symbols missing. I am just removing the files from the test location, and going to upload the original copied ones again, then check the file permissions and see what happens now i have the TESTINSTALL licence setup.

Link to comment
Share on other sites

@bfarber I have re-uploaded all of the files again, it seems more stable but the icons are still missing as shown in my first post. I have added the constants.php file with the following added to it:

 

This is what my folders look like on my file manager on the server:

image.png.d90433539245d25e3f366f79f44e5a15.png

Am I missing something? I don't want to do anything else in case you want to see for yourself the issue at the links above as last time i tried to adjust something it went garbled.

Mike

Link to comment
Share on other sites

15 hours ago, Paul E. said:

Your folders (datastore, uploads, etc.) are only writable by the owner of the folders. Who is the owner of these folders? Is it the same user that your web server (or PHP-fpm) is running as?

Going to ACP > Support > System Check will show issues.

This is where I got to the first time I did this. These were the issues raised:

image.png.62efab3654bc80c43a986bf2bd649675.png

 

I went into Putty as my root and changed these as it said, and this is where my issues started, it all went corrupt and garbled, if I restored the datastore files it worked again but only as it did the first time with the missing icons.

 

Why does the Applications, Plugins, and Uploads/logs say what to change to, but the Datastore and Uploads doesn't?

Link to comment
Share on other sites

I have changed those directories to what it needs to be, I needed to refresh my license data in the AdminCP about 28 times to clear the notifications. I ran the system check again and it all came back fine, but my icons are still missing! I have a datastorage warning still, this won't clear until I go to save the datastorage settings, even though I haven't changed them, it asks me to download a new costants.php file, when I click this my test site freezes and now displays this:

image.thumb.png.8db2032f5cdd6f1e998cce6bf44fd19c.png

 

This is where I get too, I haven't got a clue what is going wrong, just from changing the permissions to the recommended. If I go into my FTP and re-upload the original backup folder for datastore from my live site, it recovers and my test site will load again, but still with no icons. I have gone in and completed the system check and everything shows as green and normal as it should.

 

Can I confirm that the icons should show on a test site, or are the restricted to stop people using it as a second place? As at the moment everything seems stable with this exception. For those still following, here is the link to my test site and the link to my live one, so you can see the difference:

 

https://www.testing.ffoc.co.uk

http://www.ffoc.co.uk

Edited by FFOC
Link to comment
Share on other sites

I have just right clicked on one of the missing icons in AdminCP and selected inspect on Chrome. This comes up as errors in the console:

 

image.png.c5e5da410e6298bc919ab753630a4cd5.png

 

Is this my issue? Does this mean permissions are still invalid or is it something else?

 

EDIT: I think I have found the issue but not sure how to rectify it. It seems to be trying to look for the icons from the live site domain, as my test is on a sub domain this is obviously not being allowed. How do I get it to point at my sub domain's files?

Edited by FFOC
Link to comment
Share on other sites

You need to make those directories writable. Chmoding things 0777 isn't a great recommendation says let anything with access to this filesystem read, write, and execute things. To resolve this, the account that is executing the PHP on your server (either your web server account or your php-fpm account) need to be able to write to these directories. I realize you think things may get worse when you do this, however there is no path forward where these directories are not writable by that account.

Secondly, you'll need to verify that if you're using redis or elasticsearch, or any other resource in conjunction with your site that your test site is not hitting the same one as your live site. In an ideal world, you'd not be doing this on the same environment as your production site.

Thirdly, you'll then need to wipe cache (ACP > System > Support > Something's wrong)

Link to comment
Share on other sites

21 minutes ago, Paul E. said:

You need to make those directories writable. Chmoding things 0777 isn't a great recommendation says let anything with access to this filesystem read, write, and execute things. To resolve this, the account that is executing the PHP on your server (either your web server account or your php-fpm account) need to be able to write to these directories. I realize you think things may get worse when you do this, however there is no path forward where these directories are not writable by that account.

Secondly, you'll need to verify that if you're using redis or elasticsearch, or any other resource in conjunction with your site that your test site is not hitting the same one as your live site. In an ideal world, you'd not be doing this on the same environment as your production site.

Thirdly, you'll then need to wipe cache (ACP > System > Support > Something's wrong)

As soon as I do anything like choose somethings wrong, my test site goes all messed up like above. I have had it stable until that point as in I can click around it etc, minus the icons. I only cHModded the directories that it recommended me too.

Messed up is this, and it stays like this until i copy the datastore files back over, then goes back to the current problem:

image.thumb.png.be95615ff1662ce29ea6cb618f4d857a.png

Following on from my last reply, one of the links points to the FONTAWESOME icons on my live site, NOT, to the directory in my test site, which I guess is why they are not showing but i do not know why they are looking there.

 

When I do select something is wrong and it shows, it comes up with 2 database errors mentioned above which do not exist according to the query result from running the fixes. What shows when doing this, is identical to what shows on my live site, which is working

I have taken this over, and learnt how to get to where i am myself, but for some reason I cannot get the test site to work. Which will then only leave me of the option of upgrading the live site without checking it which is obviously a risk.

Edited by FFOC
Link to comment
Share on other sites

I'm going to ask the obvious questions, going right back to the very start of the process

  1. Have you definitely modified your conf_global.php file to point to the correct database?
  2. Have you definitely modified your conf_global.php file to change the base_url from https://ffoc.co.uk to https://testing.ffoc.co.uk ?

Also...are you still 'restoring' the live site's datastore content to the test site's datastore folder, or have you stopped doing that as previously advised? Each site has its OWN datastore content, and you should not restore the live site's content to the test site.

Link to comment
Share on other sites

1 minute ago, Paul E. said:

What's the content of your test site's constants.php?

I'm not able to load your test site (I receive a DNS error).

I don't have one, never have.  I have tried to follow the guide for making a new testinstall but it has never worked. I am not that stupid so god knows what is wrong.

Link to comment
Share on other sites

1 minute ago, Nathan Explosion said:

I'm going to ask the obvious questions, going right back to the very start of the process

  1. Have you definitely modified your conf_global.php file to point to the correct database?
  2. Have you definitely modified your conf_global.php file to change the base_url from https://ffoc.co.uk to https://testing.ffoc.co.uk ?

Also...are you still 'restoring' the live site's datastore content to the test site's datastore folder, or have you stopped doing that as previously advised? Each site has its OWN datastore content, and you should not restore the live site's content to the test site.

1: yes, and 2: yes.

 

To make it easier, I literally copied my whole site, all of the files, to my new sub domain. I then amended the conf_global file to reflect the new database details and sub domain. I did this as that is what the guide says to do. So this will copy the datastore ones too.

This is where I get the testinstall semi working. When I go to do anything, support/somethings wrong etc, it all goes garbled like above, the only way to get it back to allow me to the site or admincp is re-copying the backed up datastore files. If I don't do this I cannot get back into the admin cp.

 

I am happy to not do this again, or go into the datastore folder and delete the contents on my testinstall if that is what is needed, but that is where I am stuck. 

 

I am sorry if it seems like you are teaching very basic things, I want to learn it all but do not know where to start, I inherited this to keep our car clubs forum running, otherwise we would have lost it so I get i have a steep learning curve.

Link to comment
Share on other sites

6 minutes ago, Nathan Explosion said:

ok.

Go to the ACP, go to System -> Files -> Storage Settings. Are they all pointing to your live site folders, or to the test site's folders?

Pretty sure you're sharing data files...

From the limited view I have of ACP at the moment I shows the test ones point to the test folders. I currently cannot get into the ACP for the live site now.

Is it worth deleting all of my test files now to try and get my live site running again, then go from there?

I really do appreciate all of this help and bearing with me

 

 

Edited by FFOC
Link to comment
Share on other sites

I have my live site back now, My test site now DOES, point to the live one for some reason, even though the conf_global settings are correct.

 

As said above, could this be because I am using a sub domain to set the testinstall up with? I don't know how to set it up locally.

Link to comment
Share on other sites

Just now, FFOC said:

I have tried to follow the guide for making a new testinstall but it has never worked.

This is why I've nominated this for the first installment of "@Jordan Invision Jigs It!" The guide is not at the level it needs to be, and you're helping highlight that. We'll get it though. Keep calm and methodical.

We'd ideally isolate these into two separate environments (two separate servers, or a minimum, two separate chrooted hosting accounts).

If you're restoring your production (live) site data into a copy to create your test site, there are some things you need to seriously consider:

  1. Updating conf_global.php to make sure that you have a different database connection from production, making sure that you have a different hostname than production, and making sure that your values are correct. Use different mysql accounts for production and test, that do not have access to each others databases.
  2. Handling your member e-mails. Your test site will try and e-mail your members when the normal task processes run. You probably don't want this, and your members probably definitely don't want this. You need a constants.php in there. You should probably make sure you have \define('EMAIL_DEBUG_PATH','/dev/null'); as a minimum if you aren't taking other precautions (such as updating all of your member e-mail addresses in your test database to test values).
  3. Understanding that the files you are copying contain hardcoded references to your production site, so you will have to wipe cache (that's what you keep copying over) and rebuild it after you modify your domain in conf_global.php. Right now, you rebuild it by doing the "Something isn't working" option in ACP > System > Support. I hear that this will cease being quite so stupid in 4.6.

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...