create new tag
, view all tags


After updating PublishContrib to the latest available version, the perl publish command, and the PublishContib page, both fail with errors:

"perl publish":

Too late for "-T" option at publish line 1.

PublishContrib: TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. {PublishContrib}{Dir} must terminate in a slash

The logs show entries like this: {PublishContrib}{Dir} must terminate in a slash at /usr/lib/perl5/5.8.5/CGI/Carp.pm line 314. at /usr/lib/perl5/5.8.5/CGI/Carp.pm line 314 CGI::Carp::realdie('{PublishContrib}{Dir} must terminate in a slash') called at /usr/lib/perl5/5.8.5/CGI/Carp.pm line 385 CGI::Carp::die('{PublishContrib}{Dir} must terminate in a slash') called at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 73 TWiki::Contrib::Publish::new('TWiki::Contrib::Publish', 'TWiki=HASH(0x8faa2b8)') called at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 49 TWiki::Contrib::Publish::publish('TWiki=HASH(0x8faa2b8)') called at /var/www/twiki/lib/TWiki/UI.pm line 109 TWiki::UI::__ANON__() called at /var/www/twiki/lib/CPAN/lib///Error.pm line 379 eval {...} called at /var/www/twiki/lib/CPAN/lib///Error.pm line 371 Error::subs::try('CODE(0x9abd8c4)', 'HASH(0x9a9e2e8)') called at /var/www/twiki/lib/TWiki/UI.pm line 158 TWiki::UI::run('CODE(0x915274c)') called TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. {PublishContrib}{Dir} must terminate in a slash

When I test with perl -cT publish I get "publish syntax OK", but I can't get any further.


TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RHEL4
Web server: apache2
Perl version: 5.8.5
Client OS: RHEL4
Web Browser: Firefox
Categories: Fatal error, Plugins, Add-Ons

-- JohnDeStefano - 11 May 2007


ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

It seems that the configuration of this module has changed a bit since a previous release: I "fixed" the problem partially by editing bin/LocalSite.cfg and bin/LocalLib.cfg, and adding a training slash to the publishing directory variable {PublishContrib}{Dir}.

But now, when I run the publish command, it seems to work but spits out raw HTML as log output, capped at the beginning and end of the output with an error: = publish: Use of uninitialized value in split at /var/www/twiki/lib/TWiki/Contrib/Publish.pm= (lines 257 and 342).

When I publish from the PublishContrib page, it again seems to publish but ends in an error: Content-type: text/plain TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. RCS: failed to create file path: Permission denied

-- JohnDeStefano - 11 May 2007

Ignore the "use of uninitialized" warning. Someone added some slightly sloppy code, but it's irrelevant.

Can you tell me what the error reported in the Apache error log was?

-- CrawfordCurrie - 14 May 2007

Since last Friday, the Apache error logs are showing the "Use of uninitialized value in split" error, and this new one: RCS: failed to create file /var/www/twiki/data/AtlasSoftware/PublishContribHistory.txt: Permission denied at /var/www/twiki/lib/TWiki/Store/RcsFile.pm line 729.

Before that, all the same errors posted above were also coming through the Apache logs.

I'm also seeing errors like these:

publish: Argument "" isn't numeric in numeric lt (<) at /var/www/twiki/lib/TWiki/Net.pm line 63.

publish: Use of uninitialized value in subroutine entry at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Socket.pm line 373.

publish: Use of uninitialized value in print at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 342.

-- JohnDeStefano - 14 May 2007

Two things to add of note:

1. On the page given to the user during/after the publish process, the RCS error above ("failed to create file") appears as the last line at the bottom of the page, giving the user the impression that the publish job has failed. I think this problem can be fixed by running publishing as "apache" instead of "root". But is there a way to alter the results page so that this doesn't show up and scare the user, or some other message added afterward to tell them that the publish job was successful?

2. The output from perl publish web=* format=file is HTML, but it's not being formatted properly and appears as raw tags. Is there a way to fix this, or to have it output plain text?

-- JohnDeStefano - 16 May 2007

The "failed to create file" message says it all - you don't have permission to create that file.

I suspect that most of your problems are due to your using 4.0.5. Yes, it should work on 4.0.5, but it's possible that some of the recent updates have broken it. Is anyone else using it on 4.0.5?

-- CrawfordCurrie - 17 May 2007

> The "failed to create file" message says it all - you don't have permission
> to create that file.
This part was solved by running publishing as "apache" instead of "root".

You're likely right about running on 4.0.5. I've tried updating the entire TWiki to a later version but ran into problems.

Strangely, I've also noticed that publishing my webs, which used to take less than a minute to complete, is now taking about 45 minutes each time and returns lots of the "uninitialized value" and "numeric lt" errors each time.

-- JohnDeStefano - 17 May 2007

Depressing. I will have a look when I get a chance (at this rate some time in 2009 frown )

-- CrawfordCurrie - 18 May 2007

Well, that stinks. The consistent time I'm getting now for each publishing cron job is 42 minutes (used to be less than a minute), so it's contributing heavily to the load on the server machine.

Please let me know if you do get time to take a look. Also, can you tell me how to fix the publishing report output so it returns either plain text or valid HTML? It's currently printing an unreadable combination of raw tags.


-- JohnDeStefano - 23 May 2007

Sorry, closing this after more than 30 days. Please re-open if needed.

-- PeterThoeny - 06 Jul 2007

Still need help... reopening

-- JohnDeStefano - 07 Jul 2007

Please provide an updated spec of your environment, including the revs of TWiki and the contrib that you are using, the skin you are publishing with, what plugins you have installed and details such as the selected authentication method.

-- CrawfordCurrie - 12 Jul 2007

OS: Linux, RHEL4u5

TWiki: TWiki-4.0.5, Tue, 24 Oct 2006, build 11822, Plugin API version 1.1

PublishContrib: 13222 (26 Mar 2007)

Skin: "anon" skin, based on default "pattern" skin with just three customized tempate files (see attached archive)


Authentication/LoginManager: TWiki::Client::TemplateLogin

Authentication/MapUserToWikiName: true

Passwords/PasswordManager: TWiki::Users::HtPasswdUser (authenticating with Apache and Kerberos)

-- JohnDeStefano - 12 Jul 2007

Sorry, closing this after more than 30 days of inactivity...

-- PeterThoeny - 02 Sep 2007

Still need help... reopening

-- JohnDeStefano - 08 Oct 2007

A bit more info on this... on checking the TWiki logs, I found that all of our webs are taking only 1 or 2 minutes to publish, except for the TWiki web itself, whose PublishContribHistory topic TWikiAdminGroup saves almost a half-hour after the previous web. So it must be on the TWiki web where it's getting hung up.

The PublishContribHistory topic contains these errors:

ERROR ATasteOfTWiki not published: Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Socket.pm line 373. at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Socket.pm line 373 Socket::sockaddr_in(80, 'undef') called at /var/www/twiki/lib/TWiki/Net.pm line 96 TWiki::Net::getUrl('TWiki::Net=HASH(0x9cbcda4)', 'http', '', 'undef', '//TWiki.org/p/pub/TWiki/TablePlugin/diamond.gif') called at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 706 TWiki::Contrib::Publish::_handleURL('TWiki::Contrib::Publish=HASH(0x9d38f80)', 'undef', 'SCALAR(0x9961064)') called at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 530 TWiki::Contrib::Publish::publishTopic('TWiki::Contrib::Publish=HASH(0x9d38f80)', 'ATasteOfTWiki', '.html', ' ERROR /var/www/twiki/pub/TWiki/ATasteOfTWikiTemplate/sidebar.gif is not readable
ERROR MISSING RESOURCE TWiki/ATasteOfTWikiTemplate/sidebar.gif
ERROR /var/www/twiki/pub/Main/TWikiAdminGroup/PatternSkinPalette.css is not readable
ERROR MISSING RESOURCE Main/TWikiAdminGroup/PatternSkinPalette.css
ERROR /var/www/twiki/pub/TWiki/TWikiPreferences/$name is not readable
ERROR MISSING RESOURCE TWiki/TWikiPreferences/$name
TWikiPreferences Rev 77 published
ERROR /var/www/twiki/pub/TWiki/TWikiPreferencesForm/$name is not readable
ERROR MISSING RESOURCE TWiki/TWikiPreferencesForm/$name
ERROR /var/www/twiki/pub/TWiki/TWikiPreferencesForm/$name is not readable
ERROR MISSING RESOURCE TWiki/TWikiPreferencesForm/$name
ERROR /var/www/twiki/pub/TWiki/WebPreferences/[WebName] is not readable
ERROR MISSING RESOURCE TWiki/WebPreferences/[WebName]
ERROR /var/www/twiki/pub/TWiki/TWikiLogos/horzTWiki.gif is not readable

The files called out as missing or unreadable do not exist in those paths; I'm not sure why they're being called... unless the latest version of PublishContrib assumes the latest version of TWiki, and these files exist in the latest version of TWiki (we're running 4.0.5).

I've also been informed that attachments on some (but not all) pages are missing. I don't know why; I'm looking into possible reasons for that now.

-- JohnDeStefano - 12 Oct 2007

Can't figure this out. Still getting multiple scalar assignment and transliteration (tr///) initialization errors on each attempt, in addition to the in split errors reported earlier. Maybe the attached log and .cfg files will provide a clue.

-- JohnDeStefano - 22 Oct 2007

Update: after researching the differences between topics whose attachments are and aren't published, I've come to the conclusion that any topics whose content had changed and had been published after the upgrade to PublishContrib do not display any atachments. In addition, the attachments themselves are not copied to the rsrc directory in the published web related to the topic.

I can only guess that this is somehow related to the change in directory syntax introduced with the upgrade. Since I had to guess at the updated syntax (in my first reply above), maybe someone could take a look and verify the syntax?

This is a critical problem with the publishing system on my end, and I would greatly appreciate any help possible.

Thank you.

-- JohnDeStefano - 31 Oct 2007

John, I'll take a look just as soon as I get a chance. I can't say when that will be, but I'll try.

-- CrawfordCurrie - 02 Nov 2007

OK, that's a bitch. Looks like the performance problem is due to TWiki.org timing out on simple accesses to URLs.

My advice is to avoid publishing the TWiki web until TWiki.org is on a server that has better than utterly crap performance.

-- CrawfordCurrie - 10 Nov 2007

Thanks Crawford.

I have upgraded EVERYTHING on my TWiki site (TWiki software itself, all plugins and contribs) to the latest version. it was painful, but it had to be done. Doing so seems to have eliminated many of the problems reported in this thread, except for the Too late for "-T" option at publish line 1. and transliteration (tr///) errors. Even publishing the TWiki web completes without failure. What would have changed in order to "fix" the time-outs to TWiki.org in the new version?

Anyway, the old instance used to send a verbose output of the results, but all I'm getting now is "TWiki to HTML publishing complete", so I can't really check for, or verify the absence of, errors.

I'm also not sure that everything is being published: it seems that only files that have changed are being published via cron, when it seemed that all files were published before that. Is that the expected behavior (publishing only the delta)?


-- JohnDeStefano - 13 Nov 2007

As an update: a user complained that his changes hadn't been published, so I ran our publishing jobs manually (they're usually run a few times a day via cron), and I found that the only thing that happens now is that the "=Too late for "-T" option at publish line 1=" error is output, and then the job exits.

I've updated everything (TWiki, contribs, etc.) to their latest versions, and this seems to have broken the publish scripts completely.

An example session:

# su apache

$ cd /var/www/twiki/bin/

$ perl publish web=MyWeb format=file skin=MyCustomPublishSkin exclusions='WebSearch*'

Too late for "-T" option at publish line 1.

It seems that running publish as a stand-alone script instead of with perl (./publish web...=) gets it to run again, but with the same raw HTML output and the same errors as before:

publish: Use of uninitialized value in print at /var/www/twiki/lib/TWiki/Contrib/Publish.pm line 389.

Use of uninitialized value in scalar assignment at LocalLib.cfg line 30.

Use of uninitialized value in transliteration (tr///) at LocalLib.cfg line 33.

Changing the original perl command from perl publish to perl -T publish seems to do the same thing, with the same errors and raw output.

-- JohnDeStefano - 30 Nov 2007

Closing this support question after more than 30 days of inactivity. Please feel free to re-open if needed.

-- PeterThoeny - 01 Jan 2008

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt LocalLib.cfg.txt r1 manage 0.5 K 2007-10-22 - 17:10 JohnDeStefano My LocalLib.cfg
Compressed Zip archivetgz changed_template_files.tgz r1 manage 1.1 K 2007-07-12 - 15:28 JohnDeStefano customized template files that differ from the default pattern templates
Texttxt publish_cron_log.txt r1 manage 4.4 K 2007-10-22 - 17:11 JohnDeStefano Sample results and errors in a cron log
Edit | Attach | Watch | Print version | History: r25 < r24 < r23 < r22 < r21 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r25 - 2008-01-01 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.