ashrafhasson

ashrafhasson

Problems with spacemacs credo and dogma

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?

Marked As Solved

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.

Also Liked

ashrafhasson

ashrafhasson

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

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

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 but you shouldn’t be getting that error with Elixir 1.8.1 and OTP 21

ashrafhasson

ashrafhasson

@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!

Where Next?

Popular in Questions Top

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement