Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-317

Badmatch error if _replicate target starts with slash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.9.1
    • 1.3
    • Replication
    • None
    • svn r761188

    • New Contributors Level (Easy)

    Description

      Giving a replication source or target which starts with a slash gives an Erlang barf error. (The wiki at http://wiki.apache.org/couchdb/Replication said that this slash was necessary. I will fix the wiki, but the error is still unsightly)

      $ curl -X POST -d '

      {"source":"/foo","target":"/bar"}

      ' http://127.0.0.1:5984/_replicate
      {"error":"case_clause","reason":"{error,{badmatch,{error,illegal_database_name,\n [

      {couch_rep,init,1}

      ,\n

      {gen_server,init_it,6}

      ,\n

      {proc_lib,init_p,5}

      ]},\n {child,undefined,\"7898c2bfbbcf8adbb305371e6c3c949e\",\n {gen_server,start_link,\n [couch_rep,\n [\"7898c2bfbbcf8adbb305371e6c3c949e\",\n {local,<<\"/foo\">>,{user_ctx,null,[<<\"_admin\">>]}},\n {local,<<\"/bar\">>,\n {user_ctx,null,[<<\"_admin\">>]}}],\n []]},\n transient,1,worker,\n [couch_rep]}}}"}

      Attachments

        1. replicate-slash-fix.patch
          0.5 kB
          Joan Touzet
        2. replicate-slash-fix-v2.patch
          1 kB
          Joan Touzet

        Activity

          People

            wohali Joan Touzet
            candlerb Brian Candler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: