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 http usage logger crashes when canceling transient (_replicate) jobs #4760

Closed
nickva opened this issue Sep 14, 2023 · 1 comment · Fixed by #4761
Closed

replicator http usage logger crashes when canceling transient (_replicate) jobs #4760

nickva opened this issue Sep 14, 2023 · 1 comment · Fixed by #4761
Labels

Comments

@nickva
Copy link
Contributor

nickva commented Sep 14, 2023

http post $DB/_replicate id=87dc15f42308e145f24d56b2dcb2f143+continuous+create_target cancel:='true'
HTTP/1.1 500 Internal Server Error
0
{
    "error": "badrpc",
    "reason": "{'EXIT',{{badrecord,httpdb},\n         [{couch_replicator_utils,url_from_type,2,\n                                  [{file,\"src/couch_replicator_utils.erl\"},\n                                   {line,308}]},\n          {couch_replicator_utils,check_endpoint_protocols,2,\n                                  [{file,\"src/couch_replicator_utils.erl\"},\n                                   {line,295}]},\n          {couch_replicator_utils,valid_endpoint_protocols_log,1,\n                                  [{file,\"src/couch_replicator_utils.erl\"},\n                                   {line,288}]},\n          {couch_replicator,replicate,2,\n                            [{file,\"src/couch_replicator.erl\"},{line,61}]}]}}"
}
@nickva nickva added the bug label Sep 14, 2023
nickva added a commit that referenced this issue Sep 14, 2023
Previously when transient replication jobs were canceled their `#rep` record's
source and target fields would be `undefined`. That was accounted for in the
http usage logger when it's enabled and resulted in a badrecord 500 error.

Fix: #4760
@nickva
Copy link
Contributor Author

nickva commented Sep 14, 2023

Example of how it fails:

5:51:14.961838 <0.7661.146> couch_replicator_utils:url_from_type({rep,undefined,undefined,undefined,
     [{cancel,true},
      {checkpoint_interval,30000},
      {connection_timeout,30000},
      {http_connections,20},
      {ibrowse_options,[]},
      {id,{"4252c9ffc7584d919a6d3899088beb5a","+continuous+create_target"}},
      {retries,5},
      {socket_options,[{keepalive,true},{nodelay,false}]},
      {use_bulk_get,false},
      {use_checkpoints,true},
      {worker_batch_size,10},
      {worker_processes,4}],
     {user_ctx,<<"testy026-user1">>,
               [<<"_admin">>,<<"_reader">>,<<"_writer">>],
               <<"default">>},
     db,nil,undefined,null,
     {1694,706674,961761},
     []}, source)
15:51:14.963080 <0.7661.146> couch_replicator_utils:url_from_type/2 error {badrecord,
                                                                           httpdb}

nickva added a commit that referenced this issue Sep 14, 2023
Previously when transient replication jobs were canceled their `#rep` record's
source and target fields would be `undefined`. That was accounted for in the
http usage logger when it's enabled and resulted in a badrecord 500 error.

Fix: #4760
nickva added a commit that referenced this issue Sep 14, 2023
Previously when transient replication jobs were canceled their `#rep` record's
source and target fields would be `undefined`. That was accounted for in the
http usage logger when it's enabled and resulted in a badrecord 500 error.

Fix: #4760
nickva added a commit that referenced this issue Sep 14, 2023
Previously when transient replication jobs were canceled their `#rep` record's
source and target fields would be `undefined`. That was accounted for in the
http usage logger when it's enabled and resulted in a badrecord 500 error.

Fix: #4760
nickva added a commit that referenced this issue Sep 14, 2023
Previously when transient replication jobs were canceled their `#rep` record's
source and target fields would be `undefined`. That was accounted for in the
http usage logger when it's enabled and resulted in a badrecord 500 error.

Fix: #4760
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.

1 participant