Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Problems setting EAs with setattr.ipl
TKeyser
I've copied out EAs and set them when copying a branch from one server to another several times before with no problems. I'm trying to do this to a particular branch now and everything is smooth until I do the setattr step. Many of the EAs are getting set correctly; others aren't getting set at all. It seems to be hit or miss.
Once done, I can find a file who's EAs were not set, go to my text file (created by saveattr.ipl), cut out the lines relevant to that file, and apply them using setattr.ipl and that file is fixed.
Can the setattr script get ahead of itself? I'm dealing with more then 50000 files and many have several EAs. I've never seen this behavior before.
Find more posts tagged with
Comments
nipper
Are you using the cached filesystem ?
if you wait a long time & then run the set_attr script is it good ?
Adam Stoller
What is the setattr.ipl script? Is this something custom that was developed at your site (by you?)? or something you downloaded from DevNet or Support?
No such script exists with the distribution of TeamSite as far as I know.
Also - can you show some of the EA setting lines that failed? Do they contain white-space in them? (that's the most likely cause of failure)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
nipper
There is a post on tech lib containing setattr.ipl. I assume he is using those. Yes, Ghoti is correct that spaces in the EAs will break this script, but it does not sound like that is the issue here, since he can rerun the script fromwhere it failed & it works.
Andy
TKeyser
Yes, these scripts came from IW. Sample EA text:
Y:\default\main\www_principal_com\WORKAREA\Work\htdocs\wellbeing\wellbeing_dec2002_execsumm.htm
TeamSite/Metadata/ExpirationDate=06/30/2006
Y:\default\main\www_principal_com\WORKAREA\Work\htdocs\wellbeing\wellbeing_dec2002_execsumm.htm
TeamSite/Metadata/MetaDescription=Well-Being Index
setattr.ipl:
#!/usr/bin/perl
#
# Script to save TeamSite EAs to a file
# File structure:
# Filename
# Attribute=Value
my($iwhome) = `iwgethome`; chomp $iwhome;
my($getAttrib) = $iwhome . "\\bin\\iwextattr -s";
# Get the attributes of a file, and print them to stdout
sub SetAttribs {
my($fname,$attrib) =
@_
;
print "$getAttrib \"$attrib\" \"$fname\"\n";
system("$getAttrib \"$attrib\" \"$fname\"");
}
while(<>) {
$fname = $_;
$attrib = <>;
chomp $attrib;
chomp $fname;
&SetAttribs($fname,$attrib);
}
nipper
back to my original Q, I do not think there are 2 mount points (cached and uncached) on DOS like on Unix. So how long after you did the copy of the files are you running this script ?
If you wait a while does it work completely ?
Andy
TKeyser
No. I did the file copy about 24 hours ago. The last attempt with setattr was about an hour ago.
nipper
hmmm, how long is the file that you are reading ? I wonder if you are running out of memory somewhere ?
Are there any errors that are posted ?
The iwextattr is (I think) a syncronous event, so the previous one should have completely finished before the next is issued.
Andy
TKeyser
The file is quite large (as these go) about 8mb or roughly 100000 lines. So it's setting about 50000 EAs.
I also believe it's synchronous.
Workarounds I've considered are adding in a fraction of a second sleep after each EA or adding in a method to extract what was just set and compare. I have a feeling that either one will slow the process down too much.
Adam Stoller
Don't know if this will help or not - but try this slightly modified version of the script and see if it works any better (or worse? or the same?):
use strict;
use warnings;
use TeamSite::Config;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
while(<>){
(my $fname = $_) =~ tr|\\|/|;
my $attrib = <>;
chomp($fname, $attrib);
SetAttribs($fname, $attrib);
}
sub SetAttribs {
my($fname,$attrib) =
@_
;
my $cmd = qq($iwhome/bin/iwextattr -s "$attrib" "$fname");
print ".";
my
@results
= qx($cmd 2>&1);
if ($?){
warn("\nERROR: $cmd\n\t@results\n");
}
}
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
stefanmaier
Hi Todd,
Do you get any error or return code?
Are you on windows?
TS6.5?
If you start your Ea setting script, open a command line and do an netstat -a.
If you see a lot of TCP connections in TIME_WAIT state, check these two threads:
TKeyser
Fish - That showed me 3 lines that had no EAs, just a blank line. Thanks! (btw, I was the guy gorging on hors devours at GearUp with you)
It's still not working though.
Stefan - I see several of those TIME_WAIT statements. I modified the registry as indicated in the articles and rebooted (just in case, it IS Windows after all). I ran netstat before I tried the EA set and there where many TIME_WAITs there already. I went ahead and ran the script and still no luck.
I've added a 1 second pause after each EA set, but I don't think it's going to help.
So strange...
Adam Stoller
Ah... GearUp ... hors devours ... it seems like so long ago ... ;-)
At this point I'd say you need to find a repeatable case and then debug the **** out of it.
It's one of those kinds of things where if we can't reproduce it - we can't provide a fix for it either.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
TKeyser
I can't wait for the next GearUp. It was probably the first conference in a long time where I actually learned something! (Lissa, are you listening???)
Much to my surprise and joy, adding the one second delay seems to be working. It's going to take all night, but files are getting updated that weren't before. At this point I'm not going to think about it, I'm just going to accept it and move on.
Thanks for all your help folks!
Migrateduser
I'm finally catching up on DevNet posts - i have months to read, Yes, another GearUp is planned for Miami in April.
Heather will be posting lots of cool information about it on DevNet in the next few weeks.
We've even got a Developer event in the works....
I'm glad people enjoyed the last ones(s)!
Regards,
lissa