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

Flush stdout when ask for password #2200

Closed
gumblex opened this issue Mar 8, 2019 · 2 comments
Closed

Flush stdout when ask for password #2200

gumblex opened this issue Mar 8, 2019 · 2 comments
Labels
category: user interface help: good first issue easy issue to get started with for beginners (both Go and restic) help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted type: bug

Comments

@gumblex
Copy link

gumblex commented Mar 8, 2019

Output of restic version

restic 0.9.4 compiled with go1.11.5 on linux/amd64
(also on git master)

How did you run restic exactly?

$ restic -r /media/backup/restic-home --verbose backup /home
open repository

What backend/server/service did you use to store the repository?

Local filesystem

Expected behavior

It should ask for password immediately.

Actual behavior

It may or may not ask for password, and stops.

Steps to reproduce the behavior

Run any command that requires password.

Do you have any idea what may have caused this?

In global.go, the Fprint is not called with a flush to stdout, so the terminal may not display the line.

Do you have an idea how to solve the issue?

Add a flush call.

Did restic help you or made you happy in any way?

Yes.

@MichaelEischer MichaelEischer added category: user interface help: good first issue easy issue to get started with for beginners (both Go and restic) help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted type: bug labels Nov 15, 2020
@pwilloughby
Copy link

The password prompt is printing to os.Stderr. os.Stderr is not buffered in go. There is no buffer to flush.

It looks to me like restic is not running in an interactive terminal. It will not prompt in this case.

You can see this behavior with ssh:

$ ssh remote_server restic --verbose -r /tmp/restic-home backup /home
open repository

ssh has an option to help with this -t Force pseudo-terminal allocation.

$ ssh -t remote_server restic --verbose -r /tmp/restic-home backup /home
open repository
enter password for repository: 

Were you able to resolve this issue? Are you still seeing the problem?

@MichaelEischer
Copy link
Member

Closing this issue as I cannot reproduce it. Feel free to reopen it, if you can provide steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: user interface help: good first issue easy issue to get started with for beginners (both Go and restic) help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted type: bug
Projects
None yet
Development

No branches or pull requests

3 participants