tecosaur / emacs-survey

Framework for an annual emacs survey. Mirror of https://git.tecosaur.net/tec/emacs-survey.
GNU General Public License v3.0
16 stars 1 forks source link

Error when starting server #1

Open yantar92 opened 2 years ago

yantar92 commented 2 years ago

Running bin/server yields the following errors on my systems:

> ./bin/server 

 _____         _
|   __|___ ___|_|___
|  |  | -_|   | | -_|
|_____|___|_|_|_|___|

| Web: https://genieframework.com
| GitHub: https://github.com/genieframework/Genie.jl
| Docs: https://www.genieframework.com/docs
| Discord: https://discord.com/invite/9zyZbD6J7H
| Twitter: https://twitter.com/GenieMVC

Active env: DEV

┌ Warning: 
│             No secret token is defined through `Genie.secret_token!("token")`. Such a token
│             is needed to hash and to encrypt/decrypt sensitive data in Genie, including cookie
│             and session data.
│ 
│             If your app relies on cookies or sessions make sure you generate a valid token,
│             otherwise the encrypted data will become unreadable between app restarts.
│ 
│             You can resolve this issue by generating a valid `config/secrets.jl` file with a
│             random token, calling `Genie.Generator.write_secrets_file()`.
│             
└ @ Genie ~/.julia/packages/Genie/CG83K/src/genie_module.jl:223
Loading initializers[ Info: 2022-05-20 15:10:05 SELECT name FROM sqlite_master  WHERE type='table'
[ Info: 2022-05-20 15:10:07 SELECT name FROM sqlite_master  WHERE type='table'
Loading routes[ Info: 2022-05-20 15:10:09 Precompiling SurveysController [top-level]
ERROR: LoadError: MethodError: Surveys.Survey(::String) is ambiguous. Candidates:
  Surveys.Survey(name::AbstractString, questions::Surveys.Question...) in Surveys at /tmp/emacs-survey/lib/Surveys.jl:208
  Surveys.Survey(name::AbstractString, parts::Surveys.SurveyPart...) in Surveys at /tmp/emacs-survey/lib/Surveys.jl:199
Possible fix, define
  Surveys.Survey(::AbstractString)
Stacktrace:
  [1] top-level scope
    @ /tmp/emacs-survey/config/survey.jl:1
  [2] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [3] include(x::String)
    @ SurveysController /tmp/emacs-survey/app/resources/surveys/SurveysController.jl:1
  [4] top-level scope
    @ /tmp/emacs-survey/app/resources/surveys/SurveysController.jl:7
  [5] include
    @ ./Base.jl:418 [inlined]
  [6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1318
  [7] top-level scope
    @ none:1
  [8] eval
    @ ./boot.jl:373 [inlined]
  [9] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [10] top-level scope
    @ none:1
in expression starting at /tmp/emacs-survey/config/survey.jl:1
in expression starting at /tmp/emacs-survey/app/resources/surveys/SurveysController.jl:1
ERROR: Failed to precompile SurveysController [top-level] to /home/yantar92/.julia/compiled/v1.7/jl_SKfoKq.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997
 [7] top-level scope
   @ /tmp/emacs-survey/routes.jl:3
in expression starting at /tmp/emacs-survey/routes.jl:3

Ready! 

┌ Info: 2022-05-20 15:10:23 
└ Web Server starting at http://0.0.0.0:8088 - press Ctrl/Cmd+C to stop the server. 
tecosaur commented 2 years ago
  1. Try calling Genie.Generator.write_secrets_file(). I'll see about making that happen automatically.
  2. I'm guessing you haven't touched https://github.com/tecosaur/emacs-survey/blob/master/config/survey.jl, the current pushed state is invalid. You need to substitute in a valid survey file.
yantar92 commented 2 years ago

Ok. I did 1 and replaced config/survey.jl with the file provided in https://yhetil.org/emacs-devel/87ee0sb3by.fsf@gmail.com/

Now, I got

> ./bin/server 

 _____         _
|   __|___ ___|_|___
|  |  | -_|   | | -_|
|_____|___|_|_|_|___|

| Web: https://genieframework.com
| GitHub: https://github.com/genieframework/Genie.jl
| Docs: https://www.genieframework.com/docs
| Discord: https://discord.com/invite/9zyZbD6J7H
| Twitter: https://twitter.com/GenieMVC

Active env: DEV

Loading initializers[ Info: 2022-05-20 17:49:18 SELECT name FROM sqlite_master  WHERE type='table'
[ Info: 2022-05-20 17:49:20 SELECT name FROM sqlite_master  WHERE type='table'
Loading routes[ Info: 2022-05-20 17:49:23 Precompiling SurveysController [top-level]
[ Info: 2022-05-20 17:49:35 Precompiling ResultsController [top-level]
ERROR: LoadError: ArgumentError: Package StatsBase not found in current path:
- Run `import Pkg; Pkg.add("StatsBase")` to install the StatsBase package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:967
 [2] include
   @ ./Base.jl:418 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1318
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:373 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:453
 [7] top-level scope
   @ none:1
in expression starting at /tmp/emacs-survey/app/resources/results/ResultsController.jl:1
ERROR: Failed to precompile ResultsController [top-level] to /home/yantar92/.julia/compiled/v1.7/jl_gYn38I.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997
 [7] top-level scope
   @ /tmp/emacs-survey/routes.jl:4
in expression starting at /tmp/emacs-survey/routes.jl:4

Ready! 

┌ Info: 2022-05-20 17:49:45 
└ Web Server starting at http://0.0.0.0:8088 - press Ctrl/Cmd+C to stop the server.