Turn All Profiles On Or Off

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

Turn All Profiles On Or Off

Postby Pirate Elf » Thu Mar 23, 2006 10:11 pm

In theory I could mod the addon "addon enabler" but I wonder if any of you perl masters is willing to whip this up for me real fast? I just want a way to turn all profiles off and all profiles on real fast. I am still having flock issues even with the new profile copier that is giving me 0 byte errors and the fastest way for me to fix it so far has been to turn off all my profiles do about 4-5 full rebuilds, partial rebuild each profile (while off) then turn them all back on.
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
 
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Postby Parahead » Sat Mar 25, 2006 4:39 pm

To me this sounds like you want a headache tablet instead of making the door post higher? ;-)

I am not sure if you refer to this fix by "the new profile copier"? When you copy a profile, do you get a new profile then? Do you change the output path afterwards before doing a build, since the 0 byte error is (probably) caused by Coranto writing to the same file and thus stucks in a dead lock. That it starts working again doesn't really have anything to do with you disabling all the profiles and do a couple of full rebuilds, since at that point the 0 byte file isn't even touched, right? It is just a certain amount of time that needs to pass for the servers internal file lock mechanism to be released.

The above is just some speculation and guessing though, really need more info about the steps you take to end up in the 0 byte situation...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Pirate Elf » Sun Mar 26, 2006 1:12 am

Yes I used that fix. Because I figured that could be my problem. I do change the output path when I do a full rebuild, but it happens every so often that when I attempt a full build I get an error. (the exact error page actually shows now thanks to a small line of code i found in another thread that basically tells me there is a problem with Xnewstopic.txt instead of just a blank page or worse)
I can't always duplicate the problem but it happens every so often. When it does happen the fastet way to fix it so far has been:

First Disable all profiles.

Second ftp into coranto (and subsequent) folder(s) and delete all 0 byte files

Third Go to partial rebuild and find the blank profile (Why does it make a
blank profile when all the xnews.txt files go 0 I have no clue but it does)

Partial rebuild blank profile and mainnewsfile profile

Keep doing it until you don't get a Blank profile anymore and you no longer have 0 Xmainnewsfile happening.

Once done Turn on all profiles and do a full rebuild about twice. This ALWAYS fixes the problem but since I couldn't tell you exactly what causes it to zero out all of them in the first place then it kind of messes up a solution. So I was just going to make an addon to make my fix a simple process.
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
 
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Postby faithless » Sun Mar 26, 2006 3:49 am

Potentially offtopic, but alot of the problems regarding files getting zeroed out are usually caused by a full disk or the user using up their allocated disk space.

A typical file IO in coranto's looks like this:
Code: Select all
my $fh = CRopen(">$file");
print $fh "something";
close($fh);

The file is truncated and opened for output, being created if necessary. However, if the disk is full, the file still gets truncated and nothing gets written to it, hence getting zeroed out. There is no error message returned to the user, letting him know that a file IO error occured and thus causes the user to panic and run around in circles trying to find out what went wrong.

My suggestion for Coranto is, to instead of using the close($fh) statement, to implement a CRclose wrapper to catch file closing errors similar to this:
Code: Select all
sub CRclose ($) {
   my $filehandle = shift;
   close ($filehandle) or CRdie('Some Error Message');
}


And thus instead of using the above file open and close code, we can use:
Code: Select all
my $fh = CRopen(">$file");
print $fh "something";
CRclose($fh);


Additional reading:
Eight Million Ways to die
faithless
 
Posts: 1335
Joined: Wed Oct 16, 2002 4:17 pm
Location: Infront of the Computer

Postby Pirate Elf » Sun Mar 26, 2006 7:02 am

In my case though I have plenty of space.. 30gigs to be exact to use. So interesting reading but not what my problem is.
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
 
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Postby Parahead » Sun Mar 26, 2006 2:40 pm

Pirate Elf wrote:the exact error page actually shows now thanks to a small line of code i found in another thread that basically tells me there is a problem with Xnewstopic.txt instead of just a blank page or worse
Could you please let me know in which thread you found the fix, maybe this is something that should be included into the core? And what does the message say exactly when this happens?

Pirate Elf wrote:Third Go to partial rebuild and find the blank profile (Why does it make a
blank profile when all the xnews.txt files go 0 I have no clue but it does)
I think it is the other way arround actually, the blank profile is created first for some reason and since it probably have the same settings as one of the other normal profiles it is writing to the same file as that one which makes Coranto end up in a dead lock as I described above. I remember vaguely that we have had issues with "shadow/blank profiles" before, I will try and do a little searching. Could you please post exactly your setup; version of Coranto and version of the addons you use?

I am guessing now, but do you use the headlines feature in some profiles? If so, could you try change the headline part in those to be a new normal profile instead? It could be something there in conjuction with the Partial Rebuild addon.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Sun Mar 26, 2006 2:42 pm

faithless wrote:My suggestion for Coranto is, to instead of using the close($fh) statement, to implement a CRclose wrapper to catch file closing errors similar to this:
Code: Select all
sub CRclose ($) {
   my $filehandle = shift;
   close ($filehandle) or CRdie('Some Error Message');
}
Good idea! I will add this sub into Coranto 1.31.x and make all internal close calls in Coranto use that sub instead, but it will be hard for addons to really take advantage of this new sub since the addon must work in older setups as well...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Pirate Elf » Sun Mar 26, 2006 5:48 pm

Parahead wrote:Could you please let me know in which thread you found the fix, maybe this is something that should be included into the core? And what does the message say exactly when this happens?


I can't remember exactly but you were the one that gave me the snippet so more than likely it is already in the new core. All it does is show an error screen with what went wrong when you do a full rebuild instead of a just a blank page. ie "Failed to open news.txt at path/blah" (AHAHA found it: Fix

Parahead wrote:I am guessing now, but do you use the headlines feature in some profiles? If so, could you try change the headline part in those to be a new normal profile instead? It could be something there in conjuction with the Partial Rebuild addon.

Yes, will toy with it after work and see what I come up with.
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
 
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Postby Parahead » Sun Mar 26, 2006 5:55 pm

Pirate Elf wrote:I can't remember exactly but you were the one that gave me the snippet so more than likely it is already in the new core. All it does is show an error screen with what went wrong when you do a full rebuild instead of a just a blank page. ie "Failed to open news.txt at path/blah" (AHAHA found it: Fix
Aha, OK. This really tells me that it is a file lock issue and not space problem anyway... And yes, this is indeed included in the 1.31.x release. :-)

Pirate Elf wrote:Yes, will toy with it after work and see what I come up with.
Great, let me know what you find out...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron