krpanotools encrypt exit codes

  • I'm revisiting why I'm running into situation where at random times ( perhaps 1% of the time ) the PHP script I use to encrypt my XML on the fly will error and deliver an exit code of 1, resulting in an xml error in the KRPano viewer..
    The error happens leveraging system(), exec() and proc_open().
    The current method, proc_open() either produces an exit code of 0 ( normal exit) or 1, never -1.
    With proc_open() I'm able to capture the two output streams. The output [1] (the encrypted XML) and in theory error [2]. However in no case will there be anything delivered by the error[2] pipe.
    Doing diligence I was able to find a universal "translation" for exit = 1, being, incorrect parameters passed.

    Is this the case with krpanotools when leveraging encrypt? Is there a known set of exit codes for krpanotools that I could have access to?

    Below is the section of code relevant to this situation.

    Any help, insight or direction would be greatly appreciated.

    *confused*


  • Perhaps I need to take this at a different angle.

    Using a set of commands and xml-input that are EXACTLY the same, I run the set via krpanotools encrypt routine 20 times.
    Eighteen of the 20 times the process is successful, with an exit code of 0.
    Two of the 20 times the process errors with an exit code of 1.


    What COULD be potentially causing this result?


  • Klaus,

    I have a collection of 44 XML files that have failed encryption via my method at the following link: Link to .zip of files
    I've run the contents of each one through several XML validators and they have come up clean.
    The version of krpanotools I'm using is krpano-1.19-pr16 Linux 64.
    Each one of these has produced an exit code of "1".

    Can you, or anyone, see a reason as to why these would cause an error when encrypting?

  • Hi,

    I have tested your files now a several times (but not in server script) and they were always working...


    What COULD be potentially causing this result?

    There can be basically only two possible reasons:
    - the loading of the input file would fail
    - or the writing to the output would fail

    The writing and the write-checking itself is simple standard C-code - e.g.:

    Code
    if ( fwrite(data, 1, datacount, filehandle) != datacount )
    {
      error
    }


    That means when there is an error here, the reason should be system related...

    Try searching for PHP proc and pipes problems, maybe the reason is there...

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!