# HTTP.jl unsupported keyword argument when running on Heroku, but same Docker container works fine on local machine

**URL:** <https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629>\
**Category:** Web Stack\
**Created:** [August 16, 2019, 8:04pm UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629 "2019-08-16T20:04:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)\
**Post date:** [August 16, 2019, 8:04pm UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629/1 "2019-08-16T20:04:57Z")

</div>

I have a simple Docker container ([repo link](https://github.com/milesfrain/JosekiHerokuExample)) that successfully launches on my local machine, but produces a Julia error when I attempt to run it on Heroku. It seems to be complaining that `verbose` is an unsupported keyword argument in `HTTP.serve`. Full error text at the bottom of this message.

This is the same example file found in @amellnik’s [Joseki.jl](https://github.com/amellnik/Joseki.jl) repo (but with `verbose` enabled in HTTP.serve).

Steps to reproduce:  
(These are also found with more description in the github repo readme)

```julia
git clone https://github.com/milesfrain/JosekiHerokuExample.git
cd JosekiHerokuExample
heroku login
heroku container:login
HEROKU_APP_NAME="my-app-name"
heroku create $HEROKU_APP_NAME
heroku container:push web --app $HEROKU_APP_NAME
heroku container:release web --app $HEROKU_APP_NAME
heroku logs --tail --app $HEROKU_APP_NAME

```

Observe this error:

```julia
LoadError: MethodError: no method matching listen(::getfield(HTTP.Handlers, Symbol("##4#5")){HTTP.Handlers.Router{Symbol("##363")}}, ::String, ::String; verbose=true)
Closest candidates are:
  listen(::Any, ::Union{String, IPAddr}) at /joseki_demo/.julia/packages/HTTP/U2ZVp/src/Servers.jl:206 got unsupported keyword argument "verbose"
  listen(::Any, ::Union{String, IPAddr}, !Matched::Integer; sslconfig, tcpisvalid, server, reuseaddr, connection_count, rate_limit, reuse_limit, readtimeout, verbose) at /joseki_demo/.julia/packages/HTTP/U2ZVp/src/Servers.jl:206
  listen(::Any) at /joseki_demo/.julia/packages/HTTP/U2ZVp/src/Servers.jl:206 got unsupported keyword argument "verbose"
Stacktrace:
 [1] #serve#3(::Bool, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:verbose,),Tuple{Bool}}}, ::Function, ::HTTP.Handlers.Router{Symbol("##363")}, ::String, ::String) at /joseki_demo/.julia/packages/HTTP/U2ZVp/src/Handlers.jl:345
 [2] (::getfield(HTTP.Handlers, Symbol("#kw##serve")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(HTTP.Handlers.serve), ::HTTP.Handlers.Router{Symbol("##363")}, ::String, ::String) at ./none:0
 [3] top-level scope at none:0
 [4] include at ./boot.jl:326 [inlined]
 [5] include_relative(::Module, ::String) at ./loading.jl:1038
 [6] include(::Module, ::String) at ./sysimg.jl:29
 [7] exec_options(::Base.JLOptions) at ./client.jl:267
 [8] _start() at ./client.jl:436
in expression starting at /joseki_demo/launch-server.jl:46

```

Run the same container locally and observe no errors:

```julia
docker run --rm -p 8000:8000 registry.heroku.com/$HEROKU_APP_NAME/web

```

---

<div class="post-metadata">

**Author:** ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)\
**Post date:** [August 18, 2019, 8:48pm UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629/2 "2019-08-18T20:48:10Z")

</div>

Got things working with buildpacks. Here are example deployment repos using Genie.jl and Joseki.jl.  
[https://github.com/milesfrain/GenieOnHeroku](https://github.com/milesfrain/GenieOnHeroku)  
[https://github.com/milesfrain/JosekiHerokuExample](https://github.com/milesfrain/JosekiHerokuExample)

---

<div class="post-metadata">

**Author:** ![amellnik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amellnik/32/137_2.png) [@amellnik](https://discourse.julialang.org/u/amellnik)\
**Post date:** [December 11, 2019, 1:47am UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629/3 "2019-12-11T01:47:28Z")

</div>

Hi @milesf – did you figure out the docker-on-heroku issue by any chance? I’m running into the same issue on a different cloud provider.

---

<div class="post-metadata">

**Author:** ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)\
**Post date:** [December 11, 2019, 2:09am UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629/4 "2019-12-11T02:09:27Z")

</div>

@amellnik  
Genie.jl has a [guide](https://genieframework.github.io/Genie.jl/documentation/16--Using_Genie_With_Docker.html) for deploying a generic Docker container to Heroku. Hopefully this can be adapted for Joseki.jl or any other Julia web backend.

Here are the consolidated steps from a [larger discussion](https://github.com/GenieFramework/Genie.jl/issues/174) on Genie.jl deployment.

```julia
# --- Julia -----
using Genie
Genie.newapp("MyGenieApp")
using Genie.Deploy.Docker
Docker.dockerfile()
Docker.build()

# --- System shell ------
HEROKU_APP_NAME=my-app-name
heroku create $HEROKU_APP_NAME
heroku container:push web -a $HEROKU_APP_NAME
heroku container:release web -a $HEROKU_APP_NAME
heroku logs -tail -a $HEROKU_APP_NAME

```

---

<div class="post-metadata">

**Author:** ![amellnik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amellnik/32/137_2.png) [@amellnik](https://discourse.julialang.org/u/amellnik)\
**Post date:** [December 11, 2019, 4:48am UTC](https://discourse.julialang.org/t/http-jl-unsupported-keyword-argument-when-running-on-heroku-but-same-docker-container-works-fine-on-local-machine/27629/5 "2019-12-11T04:48:58Z")

</div>

So… my `MethodError` was real. In constructing the dockerfile I forgot to parse the environment variable for the port to an integer, and that environment variable was unset on my local computer. I think this may have been what you ran into (and I think I’ve actually done this before).
