Skip to content

Instantly share code, notes, and snippets.

@Yive
Created December 11, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yive/4517fe73d444f8599c3f97608b39b50b to your computer and use it in GitHub Desktop.
Save Yive/4517fe73d444f8599c3f97608b39b50b to your computer and use it in GitHub Desktop.
Error in src/GameAPIs.cr:4: instantiating 'Kemal:Module#run()'
Kemal.run
^~~
in lib/kemal/src/kemal.cr:12: instantiating 'Kemal:Module#run(Nil)'
self.run port do
^~~
in lib/kemal/src/kemal.cr:64: instantiating 'HTTP::Server#listen()'
config.server.listen if config.env != "test"
^~~~~~
in /opt/crystal/src/http/server.cr:160: instantiating 'listen(Bool)'
def listen(reuse_port = false)
^
in /opt/crystal/src/http/server.cr:163: expanding macro
spawn handle_client(server.accept?)
^
in macro 'spawn' /opt/crystal/src/concurrent.cr:95, line 9:
1.
2. ->(
3.
4. __arg0 : typeof(server.accept?),
5.
6.
7. ) {
8. spawn(name: nil) do
> 9. handle_client(
10.
11. __arg0,
12.
13.
14. )
15. end
16.
17. }.call(server.accept?)
18.
19.
instantiating 'handle_client((TCPSocket | Nil))'
in /opt/crystal/src/http/server.cr:190: instantiating 'HTTP::Server::RequestProcessor#process((OpenSSL::SSL::Socket::Server | TCPSocket), (OpenSSL::SSL::Socket::Server | TCPSocket))'
@processor.process(io, io)
^~~~~~~
in /opt/crystal/src/http/server/request_processor.cr:16: instantiating 'process((OpenSSL::SSL::Socket::Server | TCPSocket), (OpenSSL::SSL::Socket::Server | TCPSocket), IO::FileDescriptor)'
def process(input, output, error = STDERR)
^
in /opt/crystal/src/http/server/request_processor.cr:39: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
@handler.call(context)
^~~~
in /opt/crystal/src/http/server/handlers/compress_handler.cr:12: expanding macro
{% if flag?(:without_zlib) %}
^
in macro 'macro_184149312' /opt/crystal/src/http/server/handlers/compress_handler.cr:12, line 12:
1.
2. request_headers = context.request.headers
3.
4. if request_headers.includes_word?("Accept-Encoding", "gzip")
5. context.response.headers["Content-Encoding"] = "gzip"
6. context.response.output = Gzip::Writer.new(context.response.output, sync_close: true)
7. elsif request_headers.includes_word?("Accept-Encoding", "deflate")
8. context.response.headers["Content-Encoding"] = "deflate"
9. context.response.output = Flate::Writer.new(context.response.output, sync_close: true)
10. end
11.
> 12. call_next(context)
13.
instantiating 'call_next(HTTP::Server::Context)'
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in /opt/crystal/src/http/server/handlers/error_handler.cr:15: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in /opt/crystal/src/http/server/handlers/log_handler.cr:12: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/static_file_handler.cr:8: instantiating 'call_next(HTTP::Server::Context)'
return call_next(context) if context.request.path.not_nil! == "/"
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in /opt/crystal/src/http/server/handlers/static_file_handler.cr:29: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/websocket_handler.cr:11: instantiating 'call_next(HTTP::Server::Context)'
return call_next(context) unless context.ws_route_defined?
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in /opt/crystal/src/http/server/handlers/websocket_handler.cr:39: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/null_log_handler.cr:5: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/common_log_handler.cr:12: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/common_exception_handler.cr:9: instantiating 'call_next(HTTP::Server::Context)'
call_next(context)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in lib/kemal/src/kemal/filter_handler.cr:15: instantiating 'call_next(HTTP::Server::Context)'
return call_next(context) unless context.route_defined?
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in src/GameAPIs/Middlewares/Minecraft/Images/AvatarMiddlewares.cr:107: instantiating 'call_next(HTTP::Server::Context)'
return call_next(env) unless only_match?(env)
^~~~~~~~~
in /opt/crystal/src/http/server/handler.cr:24: instantiating '(HTTP::Handler | Proc(HTTP::Server::Context, Nil))#call(HTTP::Server::Context)'
next_handler.call(context)
^~~~
in src/GameAPIs/Middlewares/Minecraft/Images/AvatarMiddlewares.cr:81: instantiating 'Base64:Module#decode_string((String | Nil))'
env.response.write(Base64.decode_string(redis.get("#{ENV["REDIS_MCPC_AVATAR"]}#{name}:#{size}")))
^~~~~~~~~~~~~
in /opt/crystal/src/base64.cr:184: undefined method 'to_slice' for Nil (compile-time type is (String | Nil))
slice = data.to_slice
^~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment