Skip to content

Error with edit-config command #103

@jsingh07

Description

@jsingh07

I followed the start up guide to get PES setup on two windows servers. So far I have switchover working but upon trying to configure the postgres password_configuration parameter I ran into the issue of edit-config command failing.

I have micro set up as the editor, and can successfully open the config file and edit it. Upon saving and quitting, I get the error attached below. The config file opened in micro is generated and exists in the C:\Users\Administrator\AppData\Local\Temp\2 directory. It is deleted after closing the micro editor, causing patronictl to not find the file.

I have verified the Patroni service runs under the PES user, and the PES user has full control of the C:\PES directory. When I am logged into the servers I use the Administrator account to run the commandline/powershell.

Output of the python get_app_dir

>>> import click
>>> click.get_app_dir('patroni')
'C:\\Users\\Administrator\\AppData\\Roaming\\patroni'

Edit-config Error Output

C:\PES\patroni>python patronictl.py -c patroni.yaml edit-config
Traceback (most recent call last):
  File "C:\PES\patroni\patronictl.py", line 5, in <module>
    ctl(None)
    ~~~^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\click\core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\click\core.py", line 1363, in main
    rv = self.invoke(ctx)
  File "C:\Program Files\Python313\Lib\site-packages\click\core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\click\core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\click\core.py", line 794, in invoke
    return callback(*args, **kwargs)
  File "C:\PES\patroni\patroni\ctl.py", line 2148, in edit_config
    show_diff(before_editing, after_editing)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\PES\patroni\patroni\ctl.py", line 1942, in show_diff
    markup_to_pager(PatchStream(buf), opts)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\site-packages\ydiff.py", line 634, in markup_to_pager
    pager = subprocess.Popen(
        pager_cmd, stdin=subprocess.PIPE, stdout=sys.stdout)
  File "C:\Program Files\Python313\Lib\subprocess.py", line 1039, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        pass_fds, cwd, env,
                        ^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
                        gid, gids, uid, umask,
                        ^^^^^^^^^^^^^^^^^^^^^^
                        start_new_session, process_group)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python313\Lib\subprocess.py", line 1554, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                             # no special security
                             ^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
                             cwd,
                             ^^^^
                             startupinfo)
                             ^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

The REST API command works fine.
.\curl.exe -s -X PATCH http://localhost:8008/config -d '{\"postgresql\": {\"parameters\": {\"password_encryption\": \"md5\"}}}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions