Update: Well, I've found the mongo shell and am testing with that, and I get essentially the same issue there on the problem server, so definitely not a Perl problem, but still wondering what the issue is.

I have this test program which works find on one server:
use MongoDB; use Data::Dumper; my $mdb = MongoDB->connect( 'mongodb://xxxxxxx', { username => 'xxxxx@xxxxxx.COM', auth_mechanism => 'GSSAPI', }); my $db = $mdb->get_database('testdb'); my $cfg = $db->get_collection('test_coll'); my $result = $cfg->insert_one({ name => 'test_name', test_field => 'this_is_a_test', }); my $id = $result->inserted_id(); print "Inserted: $id\n"; my $all_cfg = $cfg->find; while ( my $c = $all_cfg->next ) { print Dumper $c; }
But on another server gets this error on the insert:
MongoDB::AuthError: Authentication to //xxxxxxx:27017 failed: MongoDB: +:AuthError: GSSAPI error: MongoDB::AuthError: Could not start GSSAPI. + Did you run kinit? Error was: no mechanism available; SASL(-4): no +mechanism available: No worthy mechs found; client_start error. (Call +backs?)
And yes, I did run kinit on both systems. Authen::SASL::XS is installed on both systems, I'm not real familiar with sasl, gssapi, kerberos...and not sure where to start. How to start tracking down the problem?

In reply to MongoDB auth failure by runrig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.