"Attachment Directory can not be located" when trying to add an attachment

Started by casey_mrc, January 28, 2024, 12:42:40 PM

Previous topic - Next topic

casey_mrc

Hi

Forum mazdarotaryclub.com/forum, hosted on UK2, was working fine until the host decided to migrate everything to a new server a few days ago.

Initially, the whole forum was inaccessible. UK2 support quickly sorted this - "We have corrected the database connection string and the forum is now working"

Great, but then I discovered I could not attach files to posts. This was the message:
You cannot view this attachment.
I checked, the Attachment Directory is in the correct place and is populated.

UK2 requested I change the Attachments Directory path with a string they provided. This was the result:
You cannot view this attachment.
Note the original path status shows "Does not exist".
The UK2 path I entered shows unused with no content. HOWEVER, the issue is now resolved and attachments can be made??!!

I'm concerned to leave things like this, with no directory size or number of files showing. Can I correct this, or simply ignore?

Currently running SMF v2.1.2, PHP v7.4.

I want to update through SMF v2.1.3 to V2.1.4 asap, but reluctant to do this until I'm sure the forum attachments issue won't cause an problem.

Any help would be most appreciated.

Doug Heffernan

Can you use the repair_settings.php tool and make sure that all paths and urls are pointing to the right location?

casey_mrc

Thanks Doug.

I have put the repair_settings.php file in the correct location (/forum sub-directory, where settings.php is located).

When I enter the url, mazdarotaryclub.com/forum/repair_settings.php into my browser (Chrome) I get "404 Not found"?

What am I doing wrong?

I have temporarily renamed the php file, due to its sensitivity and the fact I have published the url on here  ;)

Illori

you should NEVER leave the file on your server even if renamed, it can cause harm to your forum if left behind.


Doug Heffernan

Quote from: casey_mrc on January 28, 2024, 01:27:09 PMThanks Doug.

I have put the repair_settings.php file in the correct location (/forum sub-directory, where settings.php is located).

When I enter the url, mazdarotaryclub.com/forum/repair_settings.php into my browser (Chrome) I get "404 Not found"?

What am I doing wrong?

I have temporarily renamed the php file, due to its sensitivity and the fact I have published the url on here  ;)

Can you double check to make really sure that it has been uploaded to the right location? The error messages indicates that that is not the case.

And as mentioned above, delete that file after you are finished with it and/or when not used. It poses a security risk if left on the server.

casey_mrc

I have tried again.

mazdarotary.com/forum/index.php in my browser correctly shows the forum home page.

I have uploaded repair_settings.php to the same directory as index.php (and settings.php). I can see the file listed OK in Filezilla FTP.

I then changed the url from .../forum/index.php to
 .../forum/repair_settings.php in my browser and get Error 404.

I feel I'm doing something stupid, but not sure what?

For security, file deleted again.

Sir Osis of Liver

mazdarotary.com/forum/index.php does not connect to your forum.  It's being redirected elsewhere.  Looks like your host has seriously screwed up.
When in Emor, do as the Snamors.
                              - D. Lister

casey_mrc

Doh, I've been an idiot!!!

My sincere apologies, long day.

mazdarotaryclub.com (missing CLUB!!)

However, everything I reported to date was "correct", I just mis-typed the domain.

I have just tried again, same result, mazdarotaryclub.com/forum/index.php fine, .../forum/repair_settings.php, Error 404


casey_mrc

Again, many thanks for the advice so far. I would appreciate any further ideas or things to try.

Kindred

Well, you do need to upgrade. You are using 2.1.2, you should be at 2.1.4

Wondering if there is a htacess restriction on repair_settings.php  or things other than index?

Although ssi_examples.php loads correctly
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Same here, I can load ssi_examples.php, subscriptions.php, agreement.txt.  Either repair_settings.php isn't in root or server is blocking it.
When in Emor, do as the Snamors.
                              - D. Lister

casey_mrc

I've replaced repair_settings.php back in the root, and I'll leave it there for an hour or so, if anyone would like to try and access it - but please don't abuse  ;)

Could the host be blocking it in some way?

Doug Heffernan

Quote from: casey_mrc on January 28, 2024, 05:51:51 PMI've replaced repair_settings.php back in the root, and I'll leave it there for an hour or so, if anyone would like to try and access it - but please don't abuse  ;)

Quote from: Illori on January 28, 2024, 01:39:08 PMyou should NEVER leave the file on your server even if renamed, it can cause harm to your forum if left behind.

Quote from: Doug Heffernan on January 28, 2024, 01:47:42 PMAnd as mentioned above, delete that file after you are finished with it and/or when not used. It poses a security risk if left on the server.


casey_mrc

OK, extra warning heeded, I have deleted the file again.

Getting desperate to sort out this attachment anomaly. Fortunately, at least the users can post attachments again  :)

casey_mrc

Quote from: Kindred on January 28, 2024, 05:21:53 PMWell, you do need to upgrade. You are using 2.1.2, you should be at 2.1.4

I plan to do the upgrades asap, but I'd rather sort this attachment anomaly before I proceed, in case it has an impact.

Quote from: Kindred on January 28, 2024, 05:21:53 PMWondering if there is a htacess restriction on repair_settings.php  or things other than index?

How can I check/correct this?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

You should be able to manually set path to attachment directory in Admin > Attachment Settings.
When in Emor, do as the Snamors.
                              - D. Lister

casey_mrc

Ouch, this is getting worse!

The new Attachment Directory path provided by the host has been entered in the admin screen and now attachments can be made by users. HOWEVER, ALL the previous attachments (20 years worth, near 3Gb) have disappeared from their respective posts!!!

You can see the new path is effectively showing the directory to contain only the 5 new attachments made since the "inability to make an attachment" has been solved.

You cannot view this attachment.

I have raised this with the host as an urgent matter. I do have a recent backup of the Attachments Directory, should it be needed.

The issue with not being able to see/run repair_settings.php from my browser was silly. I was logging in via Filezilla and uploading the file to correct location. However, I hadn't changed the server IP to the new (migrated) server IP and the host had clearly left the old server running and public, so I was uploading it to the wrong instance of the forum  :-[  I have now managed to run repair_settings.php and the path for the attachments is as shown on the attachment above.

This (below) shows the old path, which worked prior to migration, but after migration shows the Attachment Directory status as "Does not exist". Until the new, extra, path was added, no new attachments could be made.

You cannot view this attachment.

Everything was running so smoothly, until this recent server migration  :(

Another issue is that I cannot access the migrated site at the moment via FTP (only via StackCP), I simply cannot connect. Another urgent support issue raised.................

Sir Osis of Liver

If you have access to the old server, do a complete backup of all files and databases to your local computer.  If not, ask your host for a complete account backup from old server.  Do you have a backup of the production database?

When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: