Subject: 24.2; epa-file--find-file-not-found-function: Opening input file: Can't decrypt, Exit

From: Oleksandr Gavenko <[email-masked]>
Date: Sun, 18 Nov 2012 15:42:11 +0200

When I try open any .gpg files I get error:

  epa-file--find-file-not-found-function: Opening input file: Can't decrypt, Exit

Root of issue come from Emacs call:

  $ gpg "--no-tty" "--status-fd" "1" "--yes" "--enable-progress-filter" \
  "--command-fd" "0" "--output" "/tmp/epg-output3999nru" \
  "--decrypt" "--" "/home/user/.gnupg/pubring.gpg"

  gpg: WARNING: unsafe enclosing directory permissions on configuration file `/home/user/.gnupg/gpg.conf'
  [GNUPG:] PROGRESS /home/user/.gnupg/pu ? 0 22238
  [GNUPG:] UNEXPECTED 0
  gpg: decrypt_message failed: unexpected data

from call stack:

  epa-file-insert-file-contents --> epg-decrypt-file
    --> epg-start-decrypt --> epg--start
	--> (setq process
          (apply #'start-process "epg" buffer
		       (if (eq (epg-context-protocol context) 'CMS)
			   epg-gpgsm-program
			 epg-gpg-program)
		       args))

So this error occur on opening files with '.gpg' extension.

See also:

  http://unix.stackexchange.com/questions/28330/emacs-auto-encryption-and-gpg

  http://comments.gmane.org/gmane.emacs.bugs/38903
                gnupg support is no longer able to create .gpg files from
                scratch

================================================================

In GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-09-09 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  desktop-save-mode: t
  which-function-mode: t
  auto-image-file-mode: t
  icomplete-mode: t
  iswitchb-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  delete-selection-mode: t
  global-hi-lock-mode: t
  display-time-mode: t
  recentf-mode: t
  yas/global-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Decrypting /home/user/.gnupg/pubring.gpg...0%
epa-file--find-file-not-found-function: Opening input file: Can't decrypt, Unexpected; Exit

Load-path shadows:
/usr/share/emacs/24.2/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/24.2/site-lisp/cscope/xcscope hides /usr/share/emacs/site-lisp/xcscope
/usr/share/emacs24/site-lisp/quilt-el/quilt hides /usr/share/emacs/site-lisp/quilt
/usr/share/emacs24/site-lisp/flim/md4 hides /usr/share/emacs/24.2/lisp/md4
/usr/share/emacs24/site-lisp/flim/hex-util hides /usr/share/emacs/24.2/lisp/hex-util
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.2/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.2/lisp/textmodes/flyspell
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.2/lisp/textmodes/rst
/usr/share/emacs24/site-lisp/flim/ntlm hides /usr/share/emacs/24.2/lisp/net/ntlm
/usr/share/emacs24/site-lisp/flim/hmac-def hides /usr/share/emacs/24.2/lisp/net/hmac-def
/usr/share/emacs24/site-lisp/flim/sasl hides /usr/share/emacs/24.2/lisp/net/sasl
/usr/share/emacs24/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.2/lisp/net/sasl-digest
/usr/share/emacs24/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.2/lisp/net/hmac-md5
/usr/share/emacs24/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.2/lisp/net/sasl-cram
/usr/share/emacs24/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.2/lisp/net/sasl-ntlm
/usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/24.2/lisp/language/thai-word
/usr/share/emacs24/site-lisp/emms/tq hides /usr/share/emacs/24.2/lisp/emacs-lisp/tq
/usr/share/emacs/site-lisp/emacs-jabber/srv hides /home/user/usr/share/emacs/site-lisp/srv
/usr/share/emacs/24.2/lisp/emacs-lisp/ert hides /home/user/usr/share/emacs/site-lisp/nxhtml/tests/ert
/home/user/usr/share/emacs/site-lisp/rnc-mode hides /home/user/usr/share/emacs/site-lisp/nxhtml/util/rnc-mode
/usr/share/emacs/24.2/lisp/emacs-lisp/chart hides /home/user/usr/share/emacs/site-lisp/nxhtml/util/chart
/usr/share/emacs/24.2/lisp/htmlfontify hides /home/user/usr/share/emacs/site-lisp/nxhtml/util/htmlfontify

Features:
(shadow emacsbug log-view find-dired grep cl-specs edebug debug diff-mode
vc-git vc-bzr vc-sccs vc-cvs vc-rcs vc-dir ewoc dired-aux debian-copyright
readme-debian debian-changelog-mode tar-mode deb-view shell dabbrev term ehelp
electric tabify man generic apt-utils log-edit pcvs-util add-log vc ediff-merg
ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
epa-file epa epg reporter debian-bug canlock quail help-mode view newcomment
browse-url url-util url-handlers url-parse url-vars qp misearch multi-isearch
pp time-stamp nnfolder mailalias smtpmail sendmail sort smiley gnus-cite
mail-extr gnus-async gnus-bcklg gnus-ml gnus-topic utf-7 nndraft nnmh gnutls
network-stream auth-source eieio starttls nnimap parse-time tls utf7 netrc
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu
mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap
gnus-cache gnus-sum doc-view image-mode rnc-mode make-mode nxml-uchnm rng-xsd
xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse
rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap
nxml-util nxml-glyph nxml-enc xmltok rst flyspell ispell sh-script executable
vc-dispatcher vc-svn eldoc python-21 python sgml-mode vc-hg org-wl org-w3m
org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html
org-exp ob-exp org-exp-blocks find-func org-agenda org-info org-gnus
org-docview org-bibtex bibtex org-bbdb wesnoth-mode wesnoth-wml-data
wesnoth-update dictem fvwm-mode desktop ropemacs pymacs cwarn cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
which-func imenu gnus-demon nntp gnus-group gnus-undo nnmail mail-source
gnus-start gnus-spec gnus-win nnoo gnus-int gnus-range message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus gnus-ems nnheader gnus-util
mail-utils mm-util mail-prsvr ecomplete org-remember org-datetree org byte-opt
warnings bytecomp byte-compile cconv macroexp ob-emacs-lisp ob-tangle ob-ref
ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval
org-pcomplete pcomplete org-list org-faces org-compat org-entities org-macs
noutline outline format-spec cal-menu calendar cal-loaddefs remember jdone
image-file jka-compr ls-lisp ffap dired saveplace icomplete uniquify iswitchb
paren hl-line delsel hi-lock generic-x disp-table server time avoid recentf
tree-widget wid-edit autoload-my etags-select etags-table etags debian-el
debian-el-loaddefs advice advice-preload yasnippet help-fns derived edmacro
kmacro easymenu assoc w3m-load slime-autoloads compile comint regexp-opt
ansi-color ring mmm-auto mmm-vars mmm-compat cl emms-auto jabber-autoloads
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
dpkg-dev-el dpkg-dev-el-loaddefs time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

-- 
Best regards!