[ https://issues.apache.org/jira/browse/SOLR-11515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cassandra Targett resolved SOLR-11515. -------------------------------------- Resolution: Duplicate Closing as a duplicate of more recently filed SOLR-13422 since the more recent issue has been assigned. > bin/post uses "-t" to check for stdin, easily breaks when run from cron > (which has no terminal) > ----------------------------------------------------------------------------------------------- > > Key: SOLR-11515 > URL: https://issues.apache.org/jira/browse/SOLR-11515 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: scripts and tools > Reporter: Hoss Man > Priority: Major > > one of our users (matt__) spent all day on freenode#solr trying to figure out > why a simple script he had that called {{bin/post}} would work fine when he > ran it, but didn't seem to do anything when run as a cronjob. > After helping him setup better logging from cron, it ultimiately came down to > the fact that a command like this (which was the very first thing in his > script)... > {code} > bin/post -c yyy -host xxx -d '<delete><query>zzz</query></delete>' > {code} > ...was failing with an error like this... > {noformat} > Unrecognized argument: <delete><query>zzz</query></delete> > If this was intended to be a data file, it does not exist relative to > /opt/blah/blah > {noformat} > Ultimately we determined that the problem was how {{bin/post}} tests for > "stdin" -- by checking to see if it's _not_ being run in a terminal (with ' > {{! -t 0}} ') -- in which case it doesn't treat the argument after {{-d}} as > data, and instead lets it fall through to the next iteration of the arg > parsing loop (as either another switch, or a filename) > the problem here being that running (in a script) as a cronjob is another > case where {{bin/post}} is "not being run in a terminal" so the {{-d}} > parsing would up completely ignoring the {{<delete>...}} string, evne though > there was nothing being redirected on stdin. > the workaround is to use {{echo}} to give {{bin/post}} some stdin, since it > was going to expect it for any usage of {{-d}}... > {code} > echo '<delete><query>zzz</query></delete>' | bin/post -c yyy -host xxx -d > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org