Open elaine-jackson opened 4 years ago
@Blacksmoke16 This is a full error trace, hope it helps
crystal run src/ulayer.cr --error-trace 1 ↵
In src/ulayer.cr:1:1
1 | require "../config/application"
^
Error: while requiring "../config/application"
In config/application.cr:23:1
23 | require "./routes"
^
Error: while requiring "./routes"
In config/routes.cr:1:15
1 | Amber::Server.configure do
^--------
Error: instantiating 'Amber::Server.class#configure()'
In config/routes.cr:1:15
1 | Amber::Server.configure do
^--------
Error: instantiating 'Amber::Server.class#configure()'
In config/routes.cr:79:3
79 | routes :user do
^
Error: expanding macro
There was a problem expanding macro 'routes'
Called macro defined in lib/amber/src/amber/dsl/server.cr:2:3
2 | macro routes(valve, scope = "")
Which expanded to:
> 1 | router.draw :user, "" do
> 2 | begin namespace("/services") do
> 3 | namespace("/virtual_machines") do
> 4 | get("/", VirtualMachineController, :list)
> 5 | get("/:server_id", VirtualMachineController, :display)
> 6 | post("/:server_id/start", VirtualMachineController, :start)
> 7 | post("/:server_id/shutdown", VirtualMachineController, :shutdown)
> 8 | post("/:server_id/halt", VirtualMachineController, :halt)
> 9 | post("/:server_id/reset", VirtualMachineController, :reset)
> 10 | post("/:server_id/suspend", VirtualMachineController, :suspend)
> 11 | post("/:server_id/resume", VirtualMachineController, :resume)
> 12 | end
> 13 | end end
> 14 | end
> 15 |
Error: instantiating 'Amber::Router::Router#draw(Symbol, String)'
In config/routes.cr:79:3
79 | routes :user do
^
Error: expanding macro
There was a problem expanding macro 'routes'
Called macro defined in lib/amber/src/amber/dsl/server.cr:2:3
2 | macro routes(valve, scope = "")
Which expanded to:
> 1 | router.draw :user, "" do
> 2 | begin namespace("/services") do
> 3 | namespace("/virtual_machines") do
> 4 | get("/", VirtualMachineController, :list)
> 5 | get("/:server_id", VirtualMachineController, :display)
> 6 | post("/:server_id/start", VirtualMachineController, :start)
> 7 | post("/:server_id/shutdown", VirtualMachineController, :shutdown)
> 8 | post("/:server_id/halt", VirtualMachineController, :halt)
> 9 | post("/:server_id/reset", VirtualMachineController, :reset)
> 10 | post("/:server_id/suspend", VirtualMachineController, :suspend)
> 11 | post("/:server_id/resume", VirtualMachineController, :resume)
> 12 | end
> 13 | end end
> 14 | end
> 15 |
Error: instantiating 'Amber::Router::Router#draw(Symbol, String)'
There was a problem expanding macro 'get'
Called macro defined in macro 'macro_4597521920'
2 | macro get(*args)
Which expanded to:
> 1 | route :get, "/", VirtualMachineController, :list
> 2 |
> 3 | route :head, "/", VirtualMachineController, :list
> 4 |
> 5 |
> 6 | route :options, "/", VirtualMachineController, :list
> 7 |
> 8 |
Error: expanding macro
There was a problem expanding macro 'route'
Called macro defined in lib/amber/src/amber/dsl/router.cr:11:5
11 | macro route(verb, resource, controller, action, constraints = {} of String => Regex)
Which expanded to:
> 1 | __temp_2287 = ->(context : HTTP::Server::Context){
> 2 | controller = VirtualMachineController.new(context)
> 3 | controller.run_before_filter(:list) unless context.content
> 4 | unless context.content
> 5 | context.content = controller.list.to_s
> 6 | controller.run_after_filter(:list)
> 7 | end
> 8 | }
> 9 | __temp_2288 = "GET"
> 10 | __temp_2289 = Amber::Route.new(
> 11 | __temp_2288, "/", __temp_2287, :list, valve, scope, "VirtualMachineController", {} of String => Regex
> 12 | )
> 13 |
> 14 | router.add(__temp_2289)
> 15 |
Error: instantiating 'VirtualMachineController#list()'
In src/controllers/virtual_machine_controller.cr:6:57
6 | return render("./error.ecr") unless (servers = user.servers)
^------
Error: instantiating 'BlestaUser#servers()'
In src/models/blesta_user.cr:31:33
31 | shared_vms = VirtualMachine.all("WHERE ? = ANY(allowed_clients)", client.id_value)
^--
Error: instantiating 'VirtualMachine.class#all(String, (Int32 | Nil))'
In lib/granite/src/granite/querying.cr:32:30
32 | Collection(self).new(->{ raw_all(clause, params) })
^------
Error: instantiating 'raw_all(String, (Int32 | Nil))'
In lib/granite/src/granite/querying.cr:15:13
15 | adapter.select(select_container, clause, params) do |results|
^-----
Error: instantiating 'Granite::Adapter::Base+#select(Granite::Select::Container, String, (Int32 | Nil))'
In lib/granite/src/adapter/base.cr:50:25
50 | elapsed_time = Time.measure do
^------
Error: instantiating 'Time.class#measure()'
In lib/granite/src/adapter/base.cr:50:25
50 | elapsed_time = Time.measure do
^------
Error: instantiating 'Time.class#measure()'
In lib/granite/src/adapter/base.cr:51:7
51 | open do |db|
^---
Error: instantiating 'open()'
In lib/granite/src/adapter/base.cr:51:7
51 | open do |db|
^---
Error: instantiating 'open()'
In lib/granite/src/adapter/base.cr:52:12
52 | db.query statement, args: params do |rs|
^----
Error: no overload matches 'DB::Database#query' with types String, args: (Int32 | Nil)
Overloads are:
- DB::QueryMethods(Stmt)#query(query, *args_, args : Array | ::Nil = nil)
- DB::QueryMethods(Stmt)#query(query, *args_, args : Array | ::Nil = nil, &block)
╭─nathanielsuchy@Nathaniels-MacBook-Pro ~/Code/ulayer ‹master*›
╰─$ 1 ↵
This is due to the upgrade to crystal-db@0.7.0
, specifically it seems Model.all("WHERE", user_id)
where this gets passed to the select
query that is expecting an array.
Running amber in Crystal 0.30.1 encounters a Granite bug. Information is as follows.
Error output:
My shards.yml file:
My shards.lock file