Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1518

Invalid command cursor returned when listing collections on sharded cluster

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.6.14
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • Labels:
      None
    • Environment:
      PHP 5.6.26, macOS 10.12, MongoDB 3.2.10
    • # Replies:
      4
    • Last comment by Customer:
      false

      Description

      When connecting to a sharded cluster through the legacy driver, calling listCollections on a non-existing database causes an invalid command cursor to be returned:

      PHP Fatal error:  Uncaught exception 'MongoCursorException' with message 'localhost:27017: the command cursor did not return a correctly structured response' in invalid-cursor-listCollections.php:7
      Stack trace:
      #0 invalid-cursor-listCollections.php(7): MongoDB->listCollections()
      #1 {main}
        thrown in invalid-cursor-listCollections.php on line 7

      This error occurs only in a sharded setup, not when running MongoDB as standalone server. It also doesn't occur in the new driver, so I assume it's an error with the driver, not the server.

      I've added my test script and the steps to reproduce to a gist: https://gist.github.com/alcaeus/018e8e647f1a44622017f7604fe0cfcd

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            a.braun Andreas B.
            Participants:
            Last commenter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              3 years, 17 weeks, 3 days ago
              Date of 1st Reply: