Previous Thread
Next Thread
Print Thread
Hop To
#249949 08/25/2012 5:41 AM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Anyone come across a situation were each time you update a setting, config.inc.php gets wiped completely clean? (0 byte file-size.)

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
I have, but only once... and it was my fault...

I had the control panel opened and was looking at the config file there, while updating it at the same time on the server... when I updated the one in the CP, I went back to close it on the server side, and when I did the whole thing was wiped... had to go to a back-up and pull that file and insert it back on the server.

Dunny

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
It's different here; no ongoing maintenance.
Just click on Update - and 'poof' it's a blank file.

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
The portal boxes are also being written as zero byte files.

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Anybody know if a template is used to build config.inc.php ?

driv #249954 08/25/2012 10:23 AM
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
wow not sure what would cause that... unless you had a script inserted from outside..But over the years driv I have always known you to update when patches were released so shoot I am at a loss to explain that one.

I guess waiting for Giz, Ruben, or even the elusive SD would be better than me guessing, however check permissions.. I honestly think that it may be a corrupt DB table causing the issue, but then I wouldn't be able to tell you which one.

Dunny

driv #249955 08/25/2012 11:31 AM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Checked permissions. Can't see what db tables would have that effect..? I thought it might have been a language file or template but they all seem intact. Right now, I am going though the admin methods to try to track down the route to writing the config file.

Well thanks anyway buddy.

driv #249956 08/25/2012 12:26 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
The admin script builds the new config file correctly.
The path variables echo out correctly to the config.inc.php.

It's here, that things go wrong and the file is wiped clean...
Code
$check = lock_and_write("{$config['FULL_PATH']}/includes/config.inc.php",$newconf);
if ($check == "no_write") {
	$admin->error($ubbt_lang['NO_WRITE_CONFIG']);
} // end if

 if(!defined('INSTALL')) {

	rebuild_islands(1);

} // end if

I'm wondering if there is a setting that tells ubb whether or not it has been successfully installed?




Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Found the problem... (admin/doeditconfig.php)

I believe there may be an issue with the ubbthreads function lock_and_write (I haven't found it yet but will keep looking).

This was the offending code block. (n.b. I have changed he name of config.inc.php for testing.)

Code
$check = lock_and_write("{$config['FULL_PATH']}/includes/config2.inc.php",$newconf);
if ($check == "no_write") {
	$admin->error($ubbt_lang['NO_WRITE_CONFIG']);
 } // end if

Whilst looking into this, I have replaced the code above with my code below.
I don't advocate doing this as there is no file lock.
I am simply reporting to keep this thread updated for anyone else with problems.

Code
$check = file_put_contents("{$config['FULL_PATH']}/includes/config2.inc.php",$newconf);
if (empty($check)) {
$admin->error($ubbt_lang['NO_WRITE_CONFIG']);
}


This holds true also for custom islands etc.

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
DOH Well now to find SD's fix.

Dunny

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Gizmo posted a generic config file a while back.
There was some issues downloading it but there is a post in the topic that works.
https://www.ubbcentral.com/forums/ubbthreads.php/ubb/download/Number/1789/filename/config.zip
You will need to edit at least the first few lines for your urls and database username and password.
The rest you can recover from using the control panel and saving the info.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
There is nothing wrong with config.inc.php that a backup wouldn't resolve.

It's the lock_and_write function in ubbthreads.inc.php that should be shot into orbit...

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Agreed.
But until we ever get a update to resolve the issue. We are still at risk to get a wiped file.

Most uses that have reported this problem have no backup what so ever.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Point taken. Myself, I have two years of backups - talk about paranoia. wink

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Me to.
But most average users here seem to think that the host makes backups so they don't need to.
I find those people don't know how and never have made a backup.
But the first crash and they start asking questions on how to.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Originally Posted by Ruben
But most average users here seem to think that the host makes backups so they don't need to.

Burned once, about ten years ago. eek Never happened since.


driv scurries off to check his PC files...

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Originally Posted by driv
Originally Posted by Ruben
But most average users here seem to think that the host makes backups so they don't need to.

Burned once, about ten years ago. eek Never happened since.


driv scurries off to check his PC files...


Ditto... I am glad that we at least know about it... now for the fabled 7.6 to come out.

Dun

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Back to the thread... that damned function is all invasive - my styles are being wiped out at the most minor edit.

Gonna have to get it rewrite it or get SD on the case.

Thing is, I was chatting with him last night (socially) - and now it's gonna look contrived if I get in touch after a while and then ....suddenly, I 'have a problem'. frown

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
I am amazed that you all of a sudden think it is a problem.
Especially since you found a old post by him that this is a existing issue.
But maybe this post just renewed your concern on the problem.
Either way it is something I think has a priority to fix as well as the others poised for the 7.6 upgrade.
If we ever get one.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Originally Posted by Ruben
I am amazed that you all of a sudden think it is a problem

errr - no Ruben!
I think this is a problem because as of this morning, my site is being wiped out!!!

Haven't you followed this thread? I found that old thread after spending all day fault-finding.

It was only after having found the function that was at fault, that I was able to search on lock_and_write.

Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Originally Posted by driv
Originally Posted by Ruben
I am amazed that you all of a sudden think it is a problem

errr - no Ruben!
I think this is a problem because as of this morning, my site is being wiped out!!!

Haven't you followed this thread? I found that old thread after spending all day fault-finding.

It was only after having found the function that was at fault, that I was able to search on lock_and_write.

What I meant was as a old timer I thought you were already aware of the issue.
And maybe just forgot about it due to it never happened to you. Till now that you have a renewed interest.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
It's possible that I did read of this incident previously, but to be honest, I have no recollection of it.

I suppose that when our boards are running as they should, we aren't overly concerned about issues that will "never happen to us"... (cough!)

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
SD, mate; I see you are on-line, and sorry for having to ask...

I don't suppose there is a replacement function you've written to get me out of this mess, is there?

d.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
ugh.. well i had fed my modification to rick back in the 7.5.x days and really don't know if it was included.

i know it is a timing issue and there was a certain order than needed to be adhered to in order to guarantee an empty file didn't occur.

i will have to look @ the code in 7.5.6 to see if it still has the problem that i identified way back when..

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
My eternal thanks oh exalted one.... (oh, whatever, I'll buy you a pint anyways... wink )


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Gizmo), 857 guests, and 156 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)