Previous Thread
Next Thread
Print Thread
Hop To
#235763 03/25/2010 10:39 PM
Joined: Nov 2008
Posts: 45
N
newbie
newbie
N Offline
Joined: Nov 2008
Posts: 45
This is now the second time I've seen this in 7.4+ versions. My config.inc.php file is missing a whole bunch of settings that were there earlier today. It hasn't gone completely back to a "stock" setup, but a whole lot of things are missing.

The only thing that I can think of that we may have done wrong is empty the cache folder.

After that, I was working on updating a the look and feel through the header, footer, meta page. It's possible that could have something to do with it as well.

Any ideas?

Last edited by Neil Ticktin; 03/25/2010 10:40 PM.
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i've see this happen on various versions.. can't pin it down either..

but i always have a config.inc-bak.php handy as a safety net..

2c

SD #235765 03/25/2010 10:44 PM
Joined: Nov 2008
Posts: 45
N
newbie
newbie
N Offline
Joined: Nov 2008
Posts: 45
Yeah -- I will be doing that from this point on.

Joined: Nov 2008
Posts: 45
N
newbie
newbie
N Offline
Joined: Nov 2008
Posts: 45
Rick: There should be an automated -bak feature.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
are you using windows or linux?

because on windows.. the 'flock' isn't guaranteed to actually lock the file, if ISAPI (web server geek speak) is running.. since it's in multi-threaded mode.. this has always been a small 'hole' where you could have multiple admins editing things on a site and they 'collide'.. not good.

just wonderin..

from your forum headers, it looks like you are nix and on apache 2.2.13, but i might be looking @ wrong forum laugh

--edit---

the function lock_and_write (ubbthreads) really isn't done properly either..

it's opens the file for write BEFORE locking.. this essentially pre-erases the file before having exclusivity.. so there is a small window of 'zomg, dunno if it will work' and i mean VERY small window..

now in v8, the config.inc.php will be primarily read-only with most of the params moved into the DB, so that goes away..

but i'd suggest making that routine more thread safe for the very RARE cases like you prolly just ran into..

:four cents: wink

SD #235768 03/25/2010 11:25 PM
Joined: Nov 2008
Posts: 45
N
newbie
newbie
N Offline
Joined: Nov 2008
Posts: 45
>> are you using windows or linux?

Mac OS X Server

>> but i'd suggest making that routine more thread safe for the very RARE cases like you prolly just ran into..

yeah. just trying to rebuild all the things now.

any idea why anonymous users are getting this:

UBB Message
We encountered a problem. The reason reported was
Database error only visible to forum administrators
Please click back to return to the previous page.

when logged in users are fine?

Thanks!

Neil

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
prolly a query that has a NULL entry in it.. like

select from sometable where somefield in ()

note, the () <-- has no values...

my guess.. but if you are logging mysql errors, just look @ the log in your admin control panel (ubbthreads) and it will be more specific wink

and back to the proper use of 'flock'

a better approach would be to acquire the lock 1st, then truncate and write inside the lock..

example use:

PHP Code
$f=fopen("file", "r+");
flock($f, LOCK_EX) or die("Error! cant lock!");
ftruncate($f, 0);
fwrite($f, $stuff);
fclose($f); 

that is thread safe and won't have a small window where the file is erased (truncated) with no exclusivity.. smile

SD #235770 03/26/2010 12:04 AM
Joined: Nov 2008
Posts: 45
N
newbie
newbie
N Offline
Joined: Nov 2008
Posts: 45
So, it appears to be something that was in the config.inc.php file. I *think* it was related to NEW_COUNT or related flags.

I'm back up and running now ... and there is now a backup. smile

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
cool smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Gizmo, Nightcrawler), 553 guests, and 186 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)