veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.48k stars 45 forks source link

[BUG] - Could not initialize bookmarks #225

Closed k0286 closed 5 months ago

k0286 commented 6 months ago

Description

When I enter to the termscp, the dialog pops the message ' Could not initialize bookmarks (at "/home/XXX/.config/termscp/bookmarks.toml", '.

And I can not save the bookmark, no reaction after press ctrl + s

Steps to reproduce

  1. enter termscp in terminal
  2. enter any host information and save the info to bookmark via ctrl + s

Expected behaviour

the host should be save to the bookmarks

Environment

Log

2023-12-15T06:43:09.37117752Z [INFO] termscp 0.12.3 started!
2023-12-15T06:43:09.37121795Z [INFO] Starting activity manager...
2023-12-15T06:43:09.371274181Z [INFO] Setting up config client with config path /home/XXX/.config/termscp/config.toml and SSH key directory /home/XXX/.config/termscp/.ssh/
2023-12-15T06:43:09.403710609Z [ERROR] Failed to get key from storage: Provider service error
2023-12-15T06:43:09.40375086Z [INFO] Setting up theme provider with thene path /home/XXX/.config/termscp/theme.toml 
2023-12-15T06:43:09.404332233Z [INFO] Starting AuthActivity...
2023-12-15T06:43:09.404395184Z [INFO] Checking whether a new version is available...
2023-12-15T06:43:09.994975089Z [INFO] Latest version is: 0.12.3 (current)
2023-12-15T06:43:09.99515933Z [INFO] Activity initialized
2023-12-15T06:43:13.510811724Z [INFO] AuthActivity terminated due to 'Quit'
2023-12-15T06:43:13.510900665Z [INFO] AuthActivity destroyed
2023-12-15T06:43:13.526059893Z [INFO] termscp terminated with exitcode 0
veeso commented 6 months ago

have you tried with mkdir -p $HOME/.config/termscp?

LaurentFough commented 6 months ago

Recently had a similar issue. Solved it by inspecting the bookmarks file.

k0286 commented 6 months ago

Thx for the replies!

the $HOME/.config/termscp is existed. And the $HOME/termscp/bookmarks.toml looks like

[bookmarks]

[recents]

After some experiments, I find out that the bookmark function can work if the termscp run with sudo.

So I compare the logs between using sudo and without sudo.

The main difference is the following

And the log

#without sudo
2023-12-18T06:01:07.387271876Z [ERROR] Failed to get key from storage: Provider service error

#with sudo
2023-12-18T06:02:36.097700228Z [WARN] KeyringStorage is not supported; using FileStorage
veeso commented 6 months ago

DO you have gnome on ubuntu? In that case you could try to see whether the gnome-keyring is accessible to your user

k0286 commented 6 months ago

Because the server I used is a headless server, so I'm not sure the gnome-keyring is enabled or not.

But even I start the gnome-keyring-daemon manually, using the following snippet and add the module to the pam, I still get the same error message in termscp

$ eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
$ export SSH_AUTH_SOCK
mprentice commented 6 months ago

I'm running into this same problem.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale.