CouchDB
  1. CouchDB
  2. COUCHDB-1135

error on attempting to read from database

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0.2
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
      None
    • Environment:

      OS - Red Hat Enterprise Linux Server release 5.5

    • Skill Level:
      Dont Know

      Description

      Couchdb errors on attempting to read from a database

      i.e. the response to curl requests that attempt to read the namespace is

      {"error":"kill","reason":"{gen_server,call,\n [couch_server,\n {open,<<\"test_005\">>,\n [{user_ctx,\n {user_ctx,null,\n [<<\"_admin\">>],\n <<\"

      {couch_httpd_auth, default_authentication_handler}

      \">>}}]},\n infinity]}"}

      and in the log file

      [Wed, 20 Apr 2011 12:04:45 GMT] [error] [<0.125.0>] ** Generic server <0.125.0> terminating

        • Last message in was {pread_iolist,6769922532}
        • When Server state == {file,{file_descriptor,prim_file,{#Port<0.2074>,13}},
          0,6770856039}
        • Reason for termination ==
        • {{badmatch,{ok,<<13,97,115,115,101,116,95,99,97,99,104,101,95,51,104,2,
          110,4,0,226,121,136,12,104,2,97,2,97,0,104,2,109,0,0,0,
          13,97,115,115,101,116,95,99,97,99,104,101,95,56,104,2,98,
          ...

      The .couch file is 6Gb on a ext3 filesystem. Attempting to find the steps to recreate.

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Could you include any stack traces you find in the logs around that point?

        Show
        Paul Joseph Davis added a comment - Could you include any stack traces you find in the logs around that point?
        Hide
        Filipe Manana added a comment -

        Yeah, stack traces can help diagnose it better.

        I think we had 2 or 3 cases before like this, trying to read a term from an offset that doesn't point to the beginning of a serialized term. Unfortunately no one was able to reproduce them or find any bug in the code.

        The only scenario I can think of leading to this, is to have 2 Couch instances accessing and writing to the same database file.

        Nevertheless, there's a tool at https://github.com/fdmanana/couchfoo which can help a bit on the analysis.
        Try to run it like this:

        $ ./couchfoo N 10 /path/to/dbfile/db.couch

        and report the output (it's a read only operation, so you don't need to do it offline, neverhtless it's a good idea to make a backup of your file).

        Show
        Filipe Manana added a comment - Yeah, stack traces can help diagnose it better. I think we had 2 or 3 cases before like this, trying to read a term from an offset that doesn't point to the beginning of a serialized term. Unfortunately no one was able to reproduce them or find any bug in the code. The only scenario I can think of leading to this, is to have 2 Couch instances accessing and writing to the same database file. Nevertheless, there's a tool at https://github.com/fdmanana/couchfoo which can help a bit on the analysis. Try to run it like this: $ ./couchfoo N 10 /path/to/dbfile/db.couch and report the output (it's a read only operation, so you don't need to do it offline, neverhtless it's a good idea to make a backup of your file).
        Hide
        Jan Lehnardt added a comment -

        Feel free to reopen with more info.

        Show
        Jan Lehnardt added a comment - Feel free to reopen with more info.

          People

          • Assignee:
            Unassigned
            Reporter:
            Gilbert Agum
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development