Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replicator {error, undef} after update to 3.3.0 #4344

Closed
burotica49 opened this issue Jan 4, 2023 · 11 comments · Fixed by #4343
Closed

Replicator {error, undef} after update to 3.3.0 #4344

burotica49 opened this issue Jan 4, 2023 · 11 comments · Fixed by #4343
Labels

Comments

@burotica49
Copy link

Hello,

I updated my two couchDB servers from v3.2.2 to v3.3.0.
After the update, the replications no longer work
When I want to modify or redo them with Fauxton, I get an {error, undef} message

Best regard

@burotica49 burotica49 added the bug label Jan 4, 2023
@big-r81
Copy link
Contributor

big-r81 commented Jan 4, 2023

Please provide some logs!

@jcheger
Copy link

jcheger commented Jan 4, 2023

Same issue for me. No problem on 3.2.2, stuck on 3.3.0.

Using Fauxton, creating a replication (any kind) fails with error message "{error, undef}".

On the browser, the complete response is:

  • error: "forbidden"
  • reason: "{error,undef}"

On the server, the only log is "POST /_replicator 403 ok 4"

@burotica49
Copy link
Author

By creating the rule by API with Postman it works with this format:

{
    "_id": "my_rep",
    "source": "http:https://myserver.com/foo",
    "target": {
        "url": "http:https://localhost:5984/bar",
        "auth": {
            "basic": {
                "username": "user",
                "password": "pass"
            }
        }
    },
    "create_target":  true,
    "continuous": true
}


@big-r81
Copy link
Contributor

big-r81 commented Jan 4, 2023

Thanks to both of you.

To narrow down the problem:

  1. If you create the same replication via curl or Postman, the replication works?
  2. If you create a replication via Fauxton, you get the {error, undef} error?
  3. In Fauxton you give the credentials to the source and target?

@burotica49
Copy link
Author

If I create the replication not curl, it spins
If I try to create it with Fauxton in the replication part, I get the error message {error, undef}
If I modify the document directly with this format in the base _replicator it works and it turns :

{
    "_id": "my_rep",
    "source": 
        "url": "http:https://mysource.com:5984/bar",
        "auth": {
            "basic": {
                "username": "user",
                "password": "pass"
            }
        }
    "target": {
        "url": "http:https://mytarget.com:5984/bar",
        "auth": {
            "basic": {
                "username": "user",
                "password": "pass"
            }
        }
    },
    "create_target":  false,
    "continuous": true
}

I give credentials to both.
It's really the replication creation wizard that's buggy

@jcheger
Copy link

jcheger commented Jan 4, 2023

N.B. I did start on CouchDB few hours ago - I'm a total newbie

Using Fauxton 3.3.0, here is how to reproduce the error (local sync):

  • create a brand new "test1" database
  • replication / New Replication
  • Source
    • Type: local database
    • Name: test1
    • Authentication: Username and password
      • (user): admin
      • (pass): admin
  • Target
    • Type: New local database (or existing, it doesn't matter)
    • Name: test2
    • Authentication: Username and password
      • (user): admin
      • (pass): admin

It's enough to make it fail. The problem is beween Fauxton's replication wizard and the local server.

@big-r81
Copy link
Contributor

big-r81 commented Jan 4, 2023

Moved the issue to the Fauxton repo.

@rnewson
Copy link
Member

rnewson commented Jan 4, 2023

can you please grep your couch.log for 'undef' and report the full line with stacktrace if you find it?

@glynnbird
Copy link
Contributor

I attempted to reproduce and creating a document using Fauxton in the _replicator database, with a valid source and target worked just fine. But using form (e.g. http:https://127.0.0.1:5984/_utils/#/replication/_create) instead did fail with HTTP 403:

{"error":"forbidden","reason":"{error,undef}"}

(Mac M1 using Firefox)

In the logs, from the point when I submit the form I see:

[notice] 2023-01-04T16:54:43.991445Z couchdb@localhost <0.17434.0> 27974b6a26 127.0.0.1:5984 127.0.0.1 admin GET /_replicator/yyy 404 ok 2
[notice] 2023-01-04T16:54:44.012962Z couchdb@localhost <0.17818.0> c91eb7297a 127.0.0.1:5984 127.0.0.1 admin GET / 200 ok 4
[notice] 2023-01-04T16:54:44.020925Z couchdb@localhost <0.17818.0> 8726111c37 127.0.0.1:5984 127.0.0.1 admin GET / 200 ok 4
[notice] 2023-01-04T16:54:44.036423Z couchdb@localhost <0.17434.0> 5af0cdfc7c 127.0.0.1:5984 127.0.0.1 admin POST /_replicator 403 ok 8
[notice] 2023-01-04T16:54:44.848812Z couchdb@localhost <0.407.0> -------- chttpd_auth_cache changes listener died because the _users database does not exist. Create the database to silence this notice.
[error] 2023-01-04T16:54:44.848940Z couchdb@localhost emulator -------- Error in process <0.17848.0> on node couchdb@localhost with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,430}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,405}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,434}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,100}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,39}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,214}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,160}]}]}

@rnewson
Copy link
Member

rnewson commented Jan 4, 2023

Not a fauxton issue.

@rnewson
Copy link
Member

rnewson commented Jan 4, 2023

fixed by #4343

@janl janl transferred this issue from apache/couchdb-fauxton Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants