alphapapa / ement.el

A Matrix client for GNU Emacs
GNU General Public License v3.0
475 stars 44 forks source link

Bizarre curl network errors (26: read error; 9: FTP access denied) #280

Open bmp opened 2 weeks ago

bmp commented 2 weeks ago

OS/platform

openSUSE Tumbleweed 20240607 x86_64

Emacs version and provenance

"GNU Emacs 29.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-04-03"

Compiled from source from: https://git.savannah.gnu.org/cgit/emacs.git/

Emacs command

emacs --bg-daemon

Emacs frame type

emacsclient --alternate-editor= --reuse-frame --frame-parameters='(fullscreen . maximized)

Ement package version and provenance

0.16-pre 9f6cbb8 from ELPA using elpaca

Actions taken

  1. Connect with ement-connect
  2. Open ement.el room buffer or any other room
  3. Type r n to set notification rule for the room
  4. Choose any of the possible rules, Default, All messages, Mentions and keywords, None

Observed results

An error is thrown and the notification rule chosen is not applied.

Error running timer ‘plz--respond’: (wrong-type-argument arrayp nil)
Set notification rules for room: Ement.el <#ement.el:matrix.org> (<!NicAJNwJawmHrEhqZs:matrix.org>)

This is with (setq debug-on-error nil)

Expected results

The notification rules should be set, followed and no error is displayed.

Backtrace

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  #f(compiled-function (plz-error) #<bytecode 0x1a7b6a10406de7c5>)(#s(plz-error :curl-error (26 . "Read error. Various reading problems.") :response nil :message nil))
  #f(compiled-function (arg) #<bytecode -0x1d0ce6daf7ce8bd2>)(#s(plz-error :curl-error (26 . "Read error. Various reading problems.") :response nil :message nil))
  plz--respond(#<process plz-request-curl<1>> #<buffer  *plz-request-curl*> "exited abnormally with code 26\n")
  apply(plz--respond (#<process plz-request-curl<1>> #<buffer  *plz-request-curl*> "exited abnormally with code 26\n"))
  timer-event-handler([t 26217 10530 347822 nil plz--respond (#<process plz-request-curl<1>> #<buffer  *plz-request-curl*> "exited abnormally with code 26\n") nil 31000 nil])

Etc.

In addition, when (setq debug-on-error nil), if I try ement-disconnect, I get,

Ement: Writing sessions...
Ement: Disconnected (@bharathmp:matrix.org)
Error running timer ‘plz--respond’: (ement-api-error "Ement: Network error: 9: FTP access denied." #s(plz-error (9 . "FTP access denied.") nil nil))

Could this issue be related to a bookmark that I have included for activities.el from on https://github.com/alphapapa/activities.el/issues/19#issuecomment-1925700528

  (defun bmp/ement-bookmark (_bookmark)
    (ement-connect))

  (add-hook 'ement-mode-hook
            (lambda ()
              (setq-local bookmark-make-record-function
                          (lambda ()
                            `((handler . bmp/ement-bookmark))))))
alphapapa commented 2 weeks ago

Well, those errors are certainly weird:

They suggest that something is very unusual, and apparently grossly wrong, in your system or network, because they indicate that curl is failing in strange ways. FTP is not even used here.

What version of plz do you have installed, and what version of curl?

bmp commented 2 weeks ago

This is the output of curl --version

curl 8.8.0 (x86_64-suse-linux-gnu) libcurl/8.8.0 OpenSSL/3.1.4 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh/0.10.6/openssl/zlib nghttp2/1.61.0 OpenLDAP/2.6.7
Release-Date: 2024-05-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

Version of plz in Emacs is 0.9-pre 725a8d4

alphapapa commented 2 weeks ago

Well, v0.9 of plz has been released, so you could install that, but it's unlikely to matter.

I don't know what's going on here. It's bizarre. You'll probably have to spend some time playing with curl in a shell and trying to reproduce the problem, which will mean digging into plz's source code as well. Another thing you might try is to install an older version of curl and see if it makes a difference.

bmp commented 2 weeks ago

I did upgrade to v0.9 of plz and the error persists. Is there anything specific I should look at while digging into plz's source code? I shall try to downgrade curl later, is there a preferred/working version of curl I should check?

alphapapa commented 2 weeks ago

I don't know. Like I said, this is utterly bizarre. If it's feasible, my best advice is to try reproducing the problem in a virtual machine running a different Linux distro.

Other than that, you'll want to look at the function plz where the arguments to curl are collected and passed: a few on the command line, while most are passed via STDIN; you can then pass all of those via the command line while debugging and trying to reproduce the problem.

bmp commented 2 weeks ago

Will try replicating the problem on a VM and report back on this thread. Thank you.

bmp commented 5 days ago

I tried compiling Emacs from source with the following details,

Curl version:

curl 8.6.0 (x86_64-redhat-linux-gnu) libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.3.0.zlib-ng brotli/1.1.0 libidn2/2.3.7 libpsl/0.21.5 libssh/0.10.6/openssl/zlib nghttp2/1.59.0 OpenLDAP/2.6.7
Release-Date: 2024-01-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets

The operating system version:

Fedora Linux 40 (KDE Plasma) x86_64
Linux 6.9.5-200.fc40.x86_64

Emacs version:

GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0)
 of 2024-06-24

And I do not get there errors currently.

alphapapa commented 4 days ago

It would be best if you tried to use the same versions of Emacs and curl that you got the errors on. Otherwise we do not narrow the problem space, and we make no progress.