dyndnsd
                                
                                 dyndnsd copied to clipboard
                                
                                    dyndnsd copied to clipboard
                            
                            
                            
                        Crash: ERROR TypeError: no implicit conversion of nil into Array
When I call curl http://someuser:[email protected]:999/nic/update?hostname=test.dyn.example.com, I get the following error:
Sep 20 16:57:48 dns.example.com dyndnsd[1752]: - -> /nic/update?hostname=test.dyn.example.com
Sep 20 16:57:58 dns.example.com dyndnsd[1752]: [2022-09-20 16:57:58] ERROR TypeError: no implicit conversion of nil into Array
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/dyndnsd-3.6.2/lib/dyndnsd.rb:220:in `-'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/dyndnsd-3.6.2/lib/dyndnsd.rb:220:in `handle_dyndns_request'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/dyndnsd-3.6.2/lib/dyndnsd.rb:89:in `call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/rack-2.2.4/lib/rack/auth/basic.rb:28:in `call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/dyndnsd-3.6.2/lib/dyndnsd/responder/dyndns_style.rb:14:in `call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:83:in `block (3 levels) in call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack.rb:46:in `block in with_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/context.rb:87:in `with_value'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack.rb:46:in `with_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:82:in `block (2 levels) in call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/trace/tracer.rb:29:in `block in in_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/trace.rb:82:in `block in with_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/context.rb:87:in `with_value'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/trace.rb:82:in `with_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/trace/tracer.rb:29:in `in_span'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:79:in `block in call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-api-1.0.2/lib/opentelemetry/context.rb:71:in `with_current'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/opentelemetry-instrumentation-rack-0.20.2/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb:76:in `call'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/rack-2.2.4/lib/rack/handler/webrick.rb:95:in `service'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/webrick-1.7.0/lib/webrick/httpserver.rb:140:in `service'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/webrick-1.7.0/lib/webrick/httpserver.rb:96:in `run'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]:         /usr/local/share/gems/gems/webrick-1.7.0/lib/webrick/server.rb:310:in `block in start_thread'
Sep 20 16:57:58 dns.example.com dyndnsd[1752]: 150.237.94.3 - - [20/Sep/2022:16:57:58 BST] "GET /nic/update?hostname=test.dyn.example.com HTTP/1.1" 500 329
The README says I can dot his in the config file:
# ....
# user database with hostnames a user is allowed to update
users:
  # 'foo' is username, 'secret' the password
  foo:
    password: "secret"
    hosts:
      - foo.example.org
      - bar.example.org
  test:
    password: "ihavenohosts"
....yet I get the above crash when requesting for users that don't have any hosts defined.
Good catch, I think the README is promising something that my code cannot fulfill.
I'll fix that bug and release a new version.
Fixed via https://github.com/cmur2/dyndnsd/commit/3a5b1bcb271a9b6ff122433ad5f1e979ebe8b0c0 and released in version 3.7.1