Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-52044

call_external_script crashes when it gets eacces

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      If couchbase user doesn't have enough privileges to execute private key passphrase script, the call_external_script crashes with eacces and user sees the following:

      ERROR: Script executor crashed, see logs for details
      

      We need to handle this error and show sane error to the user.

      Stacktrace:

      Exception: eacces
      Stacktrace: [{erlang,open_port,
                       [{spawn_executable,
                            <<"/Users/timofey.barmin/work4/ns_server/data/n_0/scripts/asd">>},
                        [stderr_to_stdout,binary,stream,exit_status,hide,{args,[]}]],
                       [{error_info,#{module => erl_erts_errors}}]},
                   {ns_secrets,call_external_script,3,
                       [{file,"src/ns_secrets.erl"},{line,156}]},
                   {ns_secrets,extract_pkey_pass_with_script,1,
                       [{file,"src/ns_secrets.erl"},{line,134}]},
                   {ns_server_cert,set_certificate_chain,4,
                       [{file,"src/ns_server_cert.erl"},{line,951}]},
                   {menelaus_web_cert,'-handle_reload_certificate/2-fun-7-',4,
                       [{file,"src/menelaus_web_cert.erl"},{line,402}]},
                   {menelaus_util,survive_web_server_restart,1,
                       [{file,"src/menelaus_util.erl"},{line,741}]},
                   {request_tracker,request,2,
                       [{file,"src/request_tracker.erl"},{line,40}]},
                   {menelaus_util,handle_request,2,
                       [{file,"src/menelaus_util.erl"},{line,220}]}]
      

      Http call:

       curl -v -k -X POST https://Administrator:asdasd@localhost:19000/node/controller/reloadCertificate -d '{"privateKeyPassphrase":{"type":"script","path":"asd"}}'
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shaazin.sheikh Shaazin Sheikh
            timofey.barmin Timofey Barmin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty