Help → XMLRPC doesn't work after upgrading from 0.22.5 to 1.1.0 (tried with 1.0.0, too)

XMLRPC doesn't work after upgrading from 0.22.5 to 1.1.0 (tried with 1.0.0, too)

hi!

i'm using popfile in greater framework, so i require xmlrpc to work :) i'm no perl-pro, but this script worked like a charm with v0.22.5 (well, i added prints for debugging)

* upgrade from v0.22.5 to 1.1.0 has shown no errors.
* sometimes i'm able to retrieve a session key.
* i've found "432: bayes: 2046: Attempt to login with incorrect credentials for user XXXXXX" in the log, but pw for admin hasn't changed and in the db is the correct md5-hash AFAIK. - popfile doesn't complain about that at the moment!?

use strict;
use XMLRPC::Lite;

# c:\programme\popfile\perl.exe C:\smtp-proxy\check_popfile.pl MAIL OUTPUT
# %1 mail-file that shall be processed
# %2 output-file

my $xml = XMLRPC::Lite ->proxy('http://localhost:8081/RPC2') ;
print "API.get_session_key: ";
my $sk = $xml -> call('POPFile/API.get_session_key','admin','')
    -> result;
print "_".$sk."_\n";

print "API.handle_message: ";
my $ret = $xml->call('POPFile/API.handle_message',$sk, $ARGV[0], $ARGV[0].".pf");
print $ret."\n";

print "paramsall...\n";
my @res = $ret->paramsall;

print "  bucket:  ".@res[0]."\n";
print "  slot-id: ".@res[1]."\n";
print "  magnet:  ".@res[2]."\n";

unlink($ARGV[0].".pf");
open(FH, ">", $ARGV[1]);
print FH @res[0]."\nhttp://localhost:8000/jump_to_message?view=".@res[1];
close FH;

print "API.release_session_key: ";
$xml -> call('POPFile/API.release_session_key',$sk);
print $xml."\n";

1st run:

API.get_session_key: _4y2o3Fc95VdmaMPnbW3I_
API.handle_message: 1
paramsall...
  bucket:
  slot-id:
  magnet:
API.release_session_key: XMLRPC::Lite=HASH(0x1834068)

2nd run:

API.get_session_key: __
API.handle_message: 1
paramsall...
  bucket:
  slot-id:
  magnet:
API.release_session_key: XMLRPC::Lite=HASH(0x1833fe0)

output with v0.22.5 (just to prove it works)

API.get_session_key: _4cm6OhfDa45VuScN9I_
API.handle_message: 1
paramsall...
  bucket:  spam
  slot-id: 187840
  magnet:  0
API.release_session_key: XMLRPC::Lite=HASH(0x1a6d280)

i'd appreciate any useful hint to fix that.

best regards,
nik

  • Message #785

    Are you using the Windows version of POPFile?

    If so then the problem may be that I missed out a dependency when preparing the minimal Perl. I will try using XMLRPC with the Windows version of POPFile 1.1.0 and if it fails I'll try to find out what is missing.

    Brian

    • Message #786

      I will try using XMLRPC with the Windows version of POPFile 1.1.0 and if it fails I'll try to find out what is missing.

      Yes, it is a bug in the Windows version!

      I installed the Windows version of POPFile 1.1.0 and tried some sample "classify" scripts based upon the ones found in our wiki. The Python script worked OK but the Perl script produced no output (not even an error message).

      I tried using my full Perl installation to run POPFile 1.1.0 and the demo XMLRPC script and it worked OK, so there must be something missing from the minimal Perl. Now all I have to do is track it down :-)

      Brian

      • Message #787

        ACK, windows verion - sorry, i forgot to add that.
        btw, i compared the installed folder of 0.22.5 and 1.1.0 - there are only modified and added files.

        thanks!

        nik

        • Message #788

          i compared the installed folder of 0.22.5 and 1.1.0 - there are only modified and added files

          The minimal Perl changed between 0.22.5 and 1.0.0 because a newer build of Perl was available when the 1.0.0 release was prepared. For this newer build of Perl some subtle changes were introduced, e.g. a few large files were split into two parts - a smaller one with the original filename and a much larger one with a new name.

          These changes introduced some new dependencies which I had to track down. I thought I'd found them all but you have found some that I had missed! After some detective work I have been able update the minimal Perl to make the wiki's sample Perl script produce the correct output.

          The next thing I need to do is try the scripts you provided to see if they now work properly.

          I had to add a lot of files to the minimal Perl (it is now about 40% bigger than before). I may be able to trim some of these files, as I kept adding files which did not appear to have any effect.

          I expect I'll be able to build a 1.1.0a installer at the weekend which will include the files needed to make XMLRPC work better.

          Work has already started on the next release (1.1.1) and it will use a newer version of Perl than 1.1.0 so I will need to make sure XMLRPC works before the first 1.1.1 release candidate appears.

          Brian

          • Message #789

            The next thing I need to do is try the scripts you provided to see if they now work properly.

            Here is the output from my modified 1.0.0 installation:

            API.get_session_key: _uAWSO5u22EC0FM7E4k5E_
            API.handle_message: 1
            paramsall...
              bucket:  spam
              slot-id: 43
              magnet:  0
            API.release_session_key: XMLRPC::Lite=HASH(0x2813214)
            

            Looks OK to me. The next step is to see if all the extra files I added are really necessary...

            Brian

            • Message #790

              The next step is to see if all the extra files I added are really necessary...

              I think only 12 extra files need to be installed when the XMLRPC option is selected in the Windows installer. This makes the "bugfix" installer only 61 KB bigger than the 1.1.0 installer.

              My test installer passes my simple XMLRPC tests so I have uploaded it as setup-bugfix-test-1.zip (5.38 MB). I'll update ticket:103 later this evening.

              If this works on your system I'll update the main download page etc.

              Brian

              • Message #815

                If this works on your system I'll update the main download page etc.

                I've not updated the main download page because we're getting ready for the 1.1.1 release. The first release candidate has just been made available for testing.

                Brian

                • Message #848

                  at last i've tested an upgrade from 0.22.5 to 1.1.1rc1 and it works for me (6 messages; vmware; win xp sp3). though, i'm not a representative tester as i only use the xmlrpc interface.

                  hm... i'm thinking how i can stress test rc1 - i can manage to run rc1 parallel to my productive system. recently i coded a dummy pop3- (provides prepared *.eml files) and smtp-server (stores received mails as *.eml) and a bulk-sender (sends *.eml to a server) in autoit3 - nice for debugging and testing.
                  i'll have to get a physical test pc.

                  btw, did i miss one? - "improvements" states "rc2"

                  nik

                  • Message #849

                    btw, did i miss one? - "improvements" states "rc2"

                    No, you've not missed RC2. That wiki page is being updated and will be used for RC2 ... which might appear this weekend. I'm hoping to get the "Portable POPFile for Windows" beta version ready by then.

                    Brian

              • Message #793

                thanks, works as expected! - i ran my script 4x without popfile restart and still works :)

                API.get_session_key: _HFdlbK0hwkci1m0yx0Q_
                API.handle_message: 1
                paramsall...
                  bucket:  spam
                  slot-id: 187817
                  magnet:  0
                API.release_session_key: XMLRPC::Lite=HASH(0x1a64cc8)
                

                OT:
                btw, i noticed that there is a "sqlite.exe" and "sqlite3.exe". of course my backup script reported "unable to open db: file is encrypted or is not a database". s/sqlite.exe/sqlite3.exe/g and it works again. i'd rename "sqlite.exe" to "sqlite2.exe" to break old scripts intentionally after upgrading to v1.x.
                well, depends on how good the scripts are...

                nik

                • Message #794

                  thanks, works as expected!

                  I am glad the new installer worked for you. I'll make sure more XMLRPC tests are done before the next version of POPFile is released.

                  my backup script reported "unable to open db: file is encrypted or is not a database"

                  I had a similar problem with the installer and some of the utilities shipped with the Windows version of POPFile. My solution was to make the programs examine the start of the database file to see if they should use sqlite.exe or sqlite3.exe.

                  The database files start with a null-terminated string which identifies the format used in the database:

                  SQLite 2.x format 'popfile.db'
                  --------------------------------------------------------------------------------
                   00000000  2A 2A 20 54  68 69 73 20  66 69 6C 65  20 63 6F 6E  ** This file con
                   00000010  74 61 69 6E  73 20 61 6E  20 53 51 4C  69 74 65 20  tains an SQLite
                   00000020  32 2E 31 20  64 61 74 61  62 61 73 65  20 2A 2A 00  2.1 database **·
                   00000030  28 75 E3 DA  FB 12 00 00  2D 00 00 00  8E 04 00 00  (u······-·······
                   00000040  04 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ················
                  
                  SQLite 3.x format 'popfile.db' 
                   -----------------------------------------------------------------------------------
                   00000000  53 51 4C 69  74 65 20 66  6F 72 6D 61  74 20 33 00  SQLite format 3·
                   00000010  04 00 01 01  00 40 20 20  00 00 7B F1  00 00 00 00  ·····@  ··{·····
                   00000020  00 00 00 00  00 00 00 00  00 00 00 11  00 00 00 01  ················
                   00000030  00 00 00 00  00 00 00 00  00 00 00 01  00 00 00 00  ················
                   00000040  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ················
                  

                  Brian