ashrafhasson

ashrafhasson

Hi there,

I’m using credo and dogma in my elixir 1.8 project and spacemacs is giving a hard time where it gives me the following error:

Error from syntax checker elixir-dogma: JSON readtable error: 61

I understand that dogma is not required for elixir 1.6+ so I tried to remove and I get the following crash in spacemacs whenever flycheck tries to run in a buffer:

Suspicious state from syntax checker elixir-credo: Flycheck checker elixir-credo returned non-zero exit code 1, but its output contained no errors: =SUPERVISOR REPORT==== 8-Feb-2019::10:05:36.301437 ===
    supervisor: {local,'Elixir.Logger.Supervisor'}
    errorContext: start_error
    reason: noproc
    offender: [{pid,undefined},
               {id,'Elixir.Logger.ErrorHandler'},
               {mfargs,
                   {'Elixir.Logger.Watcher',watcher,
                       [error_logger,'Elixir.Logger.ErrorHandler',
                        {true,false,500},
                        link]}},
               {restart_type,permanent},
               {shutdown,5000},
               {child_type,worker}]
=CRASH REPORT==== 8-Feb-2019::10:05:36.301346 ===
  crasher:
    initial call: Elixir.Logger.Watcher:init/1
    pid: <0.89.0>
    registered_name: []
    exception exit: noproc
      in function  gen:do_for_proc/2 (gen.erl, line 228)
      in call from gen_event:rpc/2 (gen_event.erl, line 239)
      in call from 'Elixir.Logger.Watcher':init/1 (lib/logger/watcher.ex, line 66)
      in call from gen_server:init_it/2 (gen_server.erl, line 374)
      in call from gen_server:init_it/6 (gen_server.erl, line 342)
    ancestors: ['Elixir.Logger.Supervisor',<0.83.0>]
    message_queue_len: 0
    messages: []
    links: [<0.84.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 253
  neighbours:

=CRASH REPORT==== 8-Feb-2019::10:05:36.323862 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.82.0>
    registered_name: []
    exception exit: {{shutdown,
                         {failed_to_start_child,'Elixir.Logger.ErrorHandler',
                             noproc}},
                     {'Elixir.Logger.App',start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 138)
    ancestors: [<0.81.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.83.0>,normal}]
    links: [<0.81.0>,<0.43.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 193
  neighbours:

=INFO REPORT==== 8-Feb-2019::10:05:36.326731 ===
    application: logger
    exited: {{shutdown,
                 {failed_to_start_child,'Elixir.Logger.ErrorHandler',noproc}},
             {'Elixir.Logger.App',start,[normal,[]]}}
    type: temporary
** (Version.InvalidRequirementError) ~> 1.0
    (elixir) lib/version.ex:159: Version.match?/3
    (mix) lib/mix/local.ex:100: Mix.Local.check_elixir_version_in_ebin/1
    (elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:651: Enum.each/2
    (mix) lib/mix/local.ex:50: Mix.Local.append_archives/0
    (mix) lib/mix/cli.ex:8: Mix.CLI.main/1


Try installing a more recent version of elixir-credo, and please open a bug report if the issue persists in the latest release.  Thanks!

Any idea on how to get over this, please?

Showing Posts 1 to 10

NobbZ

NobbZ

Which version of elixir and erlang are you running exactly?

This looks like some known bugs that pop up here every now and then and depend on the exact versions of erlang and elixir.

ashrafhasson

ashrafhasson OP

I should have included this in my original post! :smiley:

Erlang/OTP 21 [erts-10.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.8.1 (compiled with Erlang/OTP 21)

Emacs 26.1

Spacemacs 0.200.13

also, I’m using the following credo and dogma in my mix.exs:

{:credo, “~> 1.0.0”, only: [:dev, :test], runtime: false},
{:dogma, “~> 0.1”, only: [:dev]}

Thanks!

axelson

axelson

Scenic Core Team

Since Dogma has been deprecated for over a year I’d recommend to only use credo and not dogma. Maybe dogma is having issues on Elixir 1.8+, but that seems unlikely since you’re getting an error from credo.

What version of Credo are you using? Are you using the latest version?

The Version.InvalidRequirementError sounds like this issue: Mix error corresponding to erlang-20rc.1 version - #4 by michalmuskala but you shouldn’t be getting that error with Elixir 1.8.1 and OTP 21

ashrafhasson

ashrafhasson OP

@axelson Yeah I thought the same and I did remove dogma but the issue appears to come from credo as you mentioned.
I initially had credo 1.0.0 and tried 1.0.2 (which is the latest I think) with the same effect ..

I downgraded to erlang 20.3 and elixir 1.7.0 to test but the issue persists! Additionally, elixir 1.7.0 built against erlang 21.2 also gives the same error.

I can downgrade elixir to 1.6 just for testing although I don’t think that’ll be a long term plan for me since I’ll have to upgrade at some point.

Yes, I’ve read this post too. It sounds similar to the error I’m getting although a different module/package.

Maybe it’s safe to assume the issue is with credo?

Thanks,

axelson

axelson

Scenic Core Team

Do you get the same error if you run credo from the command line instead of via emacs?

ashrafhasson

ashrafhasson OP

mix credo runs fine! It’s just when run in Spacemacs that I get the errors mentioned.

axelson

axelson

Scenic Core Team

Hmmm, how is elixir installed? Maybe spacemacs is picking up a global installation of Elixir that is different than the version you are getting at the command line.

ashrafhasson

ashrafhasson OP

@axelson, thanks for the hint!
I use kiex for Elixir and the default is 1.7.0 compiled against Erlang 20.3 while Erlang is managed with kerl and the default I set in bashrc is also 20.3. I have other installations but upon starting a new terminal these defaults seems to be the effective ones. The culprit is exenv (totally forgot it was installed and failed to check the elixir command path too :confused:) and its default elixir build/installation. I forgot I used to use it instead of kiex .. been hard coming back to an old laptop

Running elixir --version now gives me the following error:

Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

{"init terminating in do_boot",{{badmatch,error},[{'Elixir.System',build,0,[{file,"lib/system.ex"},{line,164}]},{'Elixir.System',build_info,0,[{file,"lib/system.ex"},{line,156}]},{'Elixir.Kernel.CLI',parse_shared,2,[{file,"lib/kernel/cli.ex"},{line,153}]},{'Elixir.Kernel.CLI','shared_option?',3,[{file,"lib/kernel/cli.ex"},{line,113}]},{'Elixir.Kernel.CLI',main,1,[{file,"lib/kernel/cli.ex"},{line,14}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({{badmatch,error},[{Elixir.System,build,0,[{_},{_}]},{Elixir.System,build_info,0,[{_},{_}]},{Elixir.Kernel.CLI,parse_shared,2,[{_},{_}]},{Elixir.Kernel.CLI,shared_option?,

Crash dump is being written to: erl_crash.dump...done

and when I try to run iex -S mix phoenix.server inside my projct, I get the following:

Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

** (Version.InvalidRequirementError) ~> 1.0
    (elixir) lib/version.ex:159: Version.match?/3
    (mix) lib/mix/local.ex:100: Mix.Local.check_elixir_version_in_ebin/1
    (elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:651: Enum.each/2
    (mix) lib/mix/local.ex:50: Mix.Local.append_archives/0
    (mix) lib/mix/cli.ex:8: Mix.CLI.main/1

I was prompted to check my defaults beyond kerl and kiex by your hint about global installations, thank you!

axelson

axelson

Scenic Core Team

At least everything is consistent now! Is there any reason not to use at least Elixir 1.7.4? But Elixir 1.7.0 and Erlang 20.3 should work together fine. You may want to try reinstalling everything. Also I like to use asdf instead of kerl and kiex (although the asdf plugins for elixir and erlang do use kerl and kiex under the hood). Also what operating system are you on?

ashrafhasson

ashrafhasson OP

No reason why not use 1.7.4. I’ll probably upgrade soon.
I’m developing on OSX 10.14 but attempting to deploy to Ubuntu 16.04.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews