broken pipe error

Post Reply
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

broken pipe error

Post by aitchon »

I have a script that exits at this line:

<urlutil charsetconv $var $charset "UTF-8">

Here's the error from vortex.log:
(5761) Can't write stdout: Broken pipe; exiting

Why is it exiting at this point?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

broken pipe error

Post by mark »

That usually means that the end user hit the stop button on their browser or navigated away from the page.
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

broken pipe error

Post by aitchon »

Any other explanation? The script isn't a web page. It's a script run from the command line.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

broken pipe error

Post by mark »

Is the script output being redirected to a pipe or run from a cron job? (cron will pipe to sendmail).

What's your texis -version?
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

broken pipe error

Post by aitchon »

It's a cron job and seems to run fine when run directly but not in cron. Might it have something to do with permissions?

Commercial Version 5.01.1196151211 20071127 (i686-unknown-linux2.6.9-64-32)
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

broken pipe error

Post by mark »

Presumably the cron job is owned by the same user you were logged in as when running it by hand. Cron will run the job from that user's home dir. Make sure it works as expected there. Also note that cron will run with a specific controlled environment that may differ from that of your login shell. In particular any variables set or modified by your shell profiles will not be set.

Check your cron and/or sendmail logs to see if there's anything interesting there.
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

broken pipe error

Post by aitchon »

I get the broken pipe error on this statement and the script exits:
<submit method=post URL=$urltotry siteid=$SITEID>


Here's the error:

006 2014-01-04 10:24:12 /mnt/data/ftp/bradmindb/scripts/threadtriggerforumlist:326: (3549) Can't write stdout: Broken pipe; exiting

Why is the submit statement trying to write to stdout?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

broken pipe error

Post by mark »

It may have been flushing queued output to the client at that point.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

broken pipe error

Post by Kai »

There could be additional text (whitespace?) on the same line as the `<submit>' that is being printed, causing the flush as Mark mentioned. Or it's simply a difference in how Vortex counts lines vs. your editor; sometimes one or the other gets confused or differs.
Post Reply