dakrone / es-mode

An Emacs major mode for interacting with Elasticsearch
GNU General Public License v3.0
195 stars 34 forks source link

Failure on Mac #58

Closed ilmostroUptake closed 7 years ago

ilmostroUptake commented 7 years ago

I keep getting the following error whenever I try to execute a query with es-mode on a Macbook Pro. Example query and result:

Issuing GET against http://redacted.server.tld:9200/_cat/indices
es--execute-string: Symbol’s function definition is void: string-trim
dakrone commented 7 years ago

Hmm okay, what version of Emacs are you using?

Also, if you do M-: and then (require 'subr-x) and then try executing the query, does it work then?

ilmostroUptake commented 7 years ago

The version is 25.2, as installed with brew.

 brew info emacs
emacs: stable 25.2 (bottled), HEAD
GNU Emacs text editor
https://www.gnu.org/software/emacs/
/usr/local/Cellar/emacs/25.1 (4,039 files, 97.9MB)
  Poured from bottle on 2017-04-05 at 03:11:21
/usr/local/Cellar/emacs/25.2 (4,044 files, 98.6MB) *
  Built from source on 2017-04-26 at 07:16:31
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/emacs.rb
==> Dependencies
Build: pkg-config ✔
Optional: dbus ✘, gnutls ✔, librsvg ✘, imagemagick@6 ✘, mailutils ✘
ilmostroUptake commented 7 years ago

That subr-x eval that you suggested allowed the query to proceed. Though, there was only the HTTP Header response returned.

Issuing GET against http://redacted.server.tld:9200/_cat/indices
es--execute-string: Symbol’s function definition is void: string-trim
subr-x
Issuing GET against http://redacted.server.tld:9200/_cat/indices
Response: Status: 200 Content-Type: "text/plain; charset=UTF-8" (32085 bytes)
dakrone commented 7 years ago

Very strange, if you set debug-on-error to t and execute the request do you get any debugging messages?

ilmostroUptake commented 7 years ago

This is the message that's displayed after I called toggle-debug-on-error.

Debugger entered--Lisp error: (void-function string-trim)
  string-trim("")
  es--execute-string("")
  es-execute-request-dwim(nil)
  funcall-interactively(es-execute-request-dwim nil)
  call-interactively(es-execute-request-dwim nil nil)
  command-execute(es-execute-request-dwim)
dakrone commented 7 years ago

Is that still after the (require 'subr-x)? string-trim is defined in subr-x so I wouldn't expect it to show up as a void function after it's been required.

ilmostroUptake commented 7 years ago

That's while running without those require changes in place; i.e. normal run that results in error.

dakrone commented 7 years ago

I pushed 82c9d0e47f7f224d1248e3455ee10c0adea327bf to fix the missing require a few days ago, if you use the latest from MELPA does it still fail?

ilmostroUptake commented 7 years ago

Excellent! Great job, @dakrone . That latest push has fixed this bug. Thank you for this project and for the quick response. Keep up the good work.