Gossamer Forum
Home : Products : Gossamer Links : Discussions :

BUG: building unwanted categories in root

Quote Reply
BUG: building unwanted categories in root
Hi,

at my site I have 10 main categories (root level). So far everything is working fine except that every now and then Links is building lots of subcategories in the main links (root) directory, where only the root categories should be built.
For some strange reason this is happening only from time to time, and not all categories are affected (there are over 400 categories in total and about 80 are built at root level). Each time I have to delete masses of directories (and avoid to delete the 'real' root level categories).

In addition some categories get built as a subdirectory of themselves, resulting in URLs like "/2/2/2/2/36/index.html" for example.

I have no idea why this is happening. I observed that it happens sometimes when nph-build.cgi is run via cron (but not everytime and not always at the same time of the day) while running it from command line I didn't notice that behaviour so far.

Is this a known error?
And how could it be fixed?

Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Try using Staggered Build.

Regards,

Eliot Lee
Quote Reply
Re: BUG: building unwanted categories in root In reply to
In Reply To:
Try using Staggered Build.
How can this be done in a cron job or via telnet?
As far as I see there is no option "--staggered" - it seems that this is only possible from the admin page.

Regards,

Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Yea...there is...you add the parametered of --staggered to the command line.

Example:

Code:

#Re-build Links SQL Directory
/path/to/cgi-bin/links/admin/nph-build.cgi --staggered > /path/to/cgi-bin/links/logs/build.log


This should go in your .sh file.

Regards,

Eliot Lee
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Thank you Eliot.

In my copy I had to add the line

($arg eq '--staggered') and build_staggered(), last CASE;

to line 50 of nph-build.cgi to allow this parameter at the command line.
Is it possible that there are different 'current' versions of LinksSQL? Or maybe this specific script was not properly updated in my installation...

Never mind.

Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: BUG: building unwanted categories in root In reply to
I know that --option worked in earlier BETAs of LINKS SQL 2.0 and also works fine in version 1.X. Could be that GT in the latest stable versions edited the codes to use only -staggered? Don't know for sure since I have not upgraded nor have tried v.2.X stable versions yet.

Regards,

Eliot Lee
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Hi,

No, you can't use staggered from shell as there is no automatic redirect like you have via the web.

Are you using foreign_char option? It sounds like it is set (which is why you have directories as numbers). Try turning this off and see if it fixes it.

The only difference between cron and running it manually is usually you are running the script from a different working directory. Try running nph-build.cgi outside of the admin directory and see if you can reproduce it.

Hope that helps,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Hi,
In Reply To:
Are you using foreign_char option? ... Try turning this off and see if it fixes it.
Yes, I do. Unfortunately it is no option for me to turn this off because I have set many hard coded links to certain categories and some external sites do link directly to our subcategories.

In Reply To:
The only difference between cron and running it manually is usually you are running the script from a different working directory. Try running nph-build.cgi outside of the admin directory and see if you can reproduce it.
In my crontab I call the nph-build script the same way I do from command line (invoking it from what is my root dir on a virtual server): "cgi-bin/links/admin/nph-build.cgi --all"
So the working directory should be the same either way, shouldn't it?

Regards,

Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: BUG: building unwanted categories in root In reply to
NO!!!! :)

This could be a virtual server problem. (Alex, maybe you didn't get that message from me <G>). It might not be your problem, but bear with me here --

What happens, is that the HTTP server "sees" the paths _differently_ than the root or cron or Telnet user.

If you can log in, and run the nph-build.cgi script via telnet without a problem, then make sure the cron user that is running the script is the _same_ as the user you logged in as. They should have the same environment -- they NEED to have the same environment!

The problem occurs when a virtual server is set up such that the telnet user sees paths to the webserver directories as:

/usr/local/homes/usr/local/etc/httpd/vhosts/servername.com/public/links

but the web-user sees the _SAME_ physical path as:

/usr/local/etc/httpd/vhosts/servername.com/public/links

(the leading '/' means "absolute path, start at the "root", and each user has a different "root" defined).

It makes _installing_ the web package a real pain, since the server paths "don't exist" from the point of view of the telnet user, which means you have to install into the physical directories, then log in via the web, and reset all the paths to the "web users" view of the site.

This creates a problem with nph-build.cgi

The .def files are _all_ set up from the point of view of the "web user", NOT the telnet or cron user!

This might be your problem. It might not be. But it's a major problem I've hit, and I've had to create two sets of configuration data for some sites I maintain, such that I use one for "installs" and "telnet builds", and the other for standard web operations. They are mutually incompatible, so the website has to be off-line during telnet builds.

I've gone so far as creating a "telnet only" build file, but each one is site specific.

NOt sure how to work around this, other than knowing Unix, and perl, and paths, etc -- or not using virtual servers on shared machines <G>.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Pugdog,

sounds like that could be the reason for my problem.
I experimented somewhat with the path and could chdir up the directory hierarchy. But it seems that the server's document root is the same as the "real" telnet absolute root.
DOCUMENT_ROOT: /customers/homepages/number/another_number/htdocs
TELNET home dir: /customers/homepages/number/another_number/htdocs

Then I added 'pwd > path.txt' to crontab to print the working dir into a file. The following was the result:
/homepages/number/another_number/htdocs
(note that there is no '/customers' at the beginning of this)

So it seems that although the path for the server's DOCUMENT_ROOT is the same as when telnetting, but the cron path is different.
I tried to make a shell script for the crontab in which I wanted to change the directory and invoke nph-build.cgi after that, but I can't get it work for some reason.

At the moment I have no further idea for a workaround...

Regards,
Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
[Update] BUG: building unwanted categories in root In reply to
Hi,

I have to update my observations described in my previous post: now I've seen this happening when running nph-build via telnet, too. So it seems not to be just an environment problem...

I am really wondering why this happens... It occurs randomly. It seems to happen more often when nph-build.cgi is run via cron. What I can't say is if this occurs also when running a build from the web admin, because the script gets a timeout and build staggered is obviously refreshing the pages too fast (there is no "done" message on the last "building category..." message before the page is refreshed and the next category pages are built).

So, does anybody else has a problem like this?
Is it in the code, or is it really a server side problem?

Andreas
http://www.archaeologie-online.de
Quote Reply
Re: BUG: building unwanted categories in root In reply to
Hi,

observing this behaviour a bit closer now for a time, I more and more come to the conclusion that it can't be a "virtual path" problem.
Now I can definitely say that the "unwanted root categories" are built regardless how nph-build.cgi is invoked.
For example I do a "build changed" via telnet and while looking at the screen output I realize that categories which definitely are not "root" are built in the links root directory. After interrupting the build with CTRL-C I start a new build in the same telnet session and, guess what, the categories just build perfectly correct!

I can't see any logic in this behaviour. The categories are built in the wrong place absolute randomly.

I really would appreciate any help on this, because the search engines are producing incorrect links to my site now (pointing to the wrong "root" directories which I delete when I see them and do a new build after that). This is really annoying - not just for me but also for the visitors who find my site at the search engine's listings.


Andreas
http://www.archaeologie-online.de