Hi,
What happened?
If I run emacs in daemon-mode (start emacs daemon and login with systemctl and open a emacsclient), magit is not able to communicate with remote server.
This post (emacs.stackexchange.com) is basically describing precisely my problem. From what I understand, emacs has (in daemon mode) some problem with loading ssh keys and that’s why magit fails.
In the post they also suggest a solution which I tried to adapt to doom emacs logic:
(package! exec-path-from-shell) ;; in packages.el
(use-package exec-path-from-shell
:config
(dolist (var '("PATH" "SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO"
"LANG" "LC_CTYPE" "NIX_SSL_CERT_FILE" "NIX_PATH" "XAUTHORITY"))
(add-to-list 'exec-path-from-shell-variables var))
(exec-path-from-shell-initialize))
But afterwards, magit is still responding with the error:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Do you have any hints for me how to fix this problem? Thanks for your time and help in advance!
Best regards Ludwig
Steps to reproduce
- Configure emacs to start at login
systemctl --user enable emacs
- Reboot && Login
- Start emacs
emacsclient -c
- Open a project with git and ssh authentification at origin
- Try magit to fetch updates
System information
Loading data dump...