[pbs-devel] [PATCH proxmox-backup v2] client: mount: flush output before exiting

Gabriel Goller g.goller at proxmox.com
Tue Jun 18 14:53:14 CEST 2024


On 18.06.2024 14:32, Friedrich Weber wrote:
>Hi Chris,
>
>On 18/06/2024 13:41, Christian Ebner wrote:
>> On 6/18/24 13:20, Friedrich Weber wrote:
>>> Thanks for tackling this! I ran into this issue (sometimes missing error
>>> output) when I was running `sudo proxmox-backup-client mount [...]` and
>>> forgot that PBS_REPOSITORY was not passed through by sudo. It looks like
>>> in this case, the patch doesn't completely fix this issue -- seems like
>>> I'm still missing the error output sometimes:
>>>
>>> $ sudo ./proxmox-backup-client mount \
>>>          "$SNAPSHOT" $FILE $PATH \
>>>          --keyfile $KEYFILE --ns $NS
>>> $ sudo ./proxmox-backup-client mount \
>>>          "$SNAPSHOT" $FILE $PATH \
>>>          --keyfile $KEYFILE --ns $NS
>>> $ sudo ./proxmox-backup-client mount \
>>>          "$SNAPSHOT" $FILE $PATH \
>>>          --keyfile $KEYFILE --ns $NS
>>> Error: unable to get (default) repository
>>
>> Hi Friedrich,
>> I just double checked by invoking the command in a for loop 10 times,
>> for all of which I do get the error message as output.
>>
>> ```bash
>> for i in $(seq 0 9)
>> do
>>     sudo proxmox-backup-client mount ct/100/2024-06-13T10:38:54Z
>> root.pxar /mnt
>> done
>> ```
>>
>> Interestingly, I do also get the output without the patch applied, so
>> therefore I did not notice (and obviously forgot to do the negative test
>> during review).
>>
>> Maybe some difference in setup?
>
>Thanks for double-checking! That's quite weird. Could it be related to
>sudo's `use_pty` setting?
>
>With `Defaults use_pty` in /etc/sudoers (the default for me) ...
>
>$ for i in $(seq 10); do sudo ./proxmox-backup-client mount foo bar baz;
>done
>
>... gives me only 2-5 lines of output.
>
>If I comment out the `Defaults use_pty` line in /etc/sudoers, I get 10
>lines of output consistently.

This fixes it for me as well when using sudo!

The output without sudo is also somewhat broken though. I always get:

     proxmox-backup-client mount "host/debian/2024-03-11T13:38:32Z" test.pxar ./mnt/
     root at debian:~/cool_mnt# Error: unable to get (default) repository





More information about the pbs-devel mailing list