Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

NextLS.DynamicSupervisor crashes on 403 Github API response #350

@jamesvl

Description

@jamesvl

Problem

When I start my editor (nvim) which in turn starts next-ls, NextLS.DynamicSupervisor terminates when it receives a 403 message for Github. It looks like it's trying to send an API request to Github for the latest version.

For me, it was because this request is not authenticated and I hit Github's API rate limit.

End Goal

If Github is not reachable, down, or returns something other than a 200 response, continue to run with the currently installed version.

Logs

85 [ERROR][2023-12-21 14:16:30] .../vim/lsp/rpc.lua:734    "rpc"   "/home/jamesvl/.cache/elixir-tools/nextls/bin/nextls"   "stderr"        "\n14:16:30.317 [error] Task #PID<0.1      97.0> started from NextLS.DynamicSupervisor terminating
** (CaseClauseError) no case clause matching: {:ok, %Req.Response{status: 403, headers: [{\"date\", \"Thu, 21 Dec 20      23 19:16:30 GMT\"}, {\"server\", \"Varnish\"}, {\"strict-transport-security\", \"max-age=31536000; includeSubdomains; preload\"}, {\"x-content-type-options\", \"nosniff\"},      {\"x-frame-options\", \"deny\"}, {\"x-xss-protection\", \"1; mode=block\"}, {\"content-security-policy\", \"default-src 'none'; style-src 'unsafe-inline'\"}, {\"access-contr      ol-allow-origin\", \"*\"}, {\"access-control-expose-headers\", \"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset      , X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset\"}, {\"content-type\", \"applica      tion/json; charset=utf-8\"}, {\"referrer-policy\", \"origin-when-cross-origin, strict-origin-when-cross-origin\"}, {\"x-github-media-type\", \"github.v3; format=json\"}, {\"x-ratelimit-limit\", \"60\"}, {\"x-ratelimit-remaining\", \"0\"}, {\"x-ratelimit-reset\", \"1703188568\"}, {\"x-ratelimit-resource\", \"core\"},
{\"x-ratelimit-used\", \"60\      "}, {\"content-length\", \"279\"}, {\"x-github-request-id\", \"--elided--\"}],

body: %{\"documentation_url\" => \"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\", \"message\" => \"API rate limit exceeded for x.x.x.43. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\"}, private: %{}}}
    (next_ls 0.15.0) lib/next_ls/updater.ex:19: NextLS.Updater.run/1
    (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: &NextLS.Updater.run/1
    Args: [[binpath: \"/home/--elided--/.cache/elixir-tools/nextls/bin/nextls\", api_host: \"https://api.github.com\", github_host: \"https://github.com\", current_version: %Version{major: 0, minor: 15, patch: 0}, logger: #PID<0.195.0>]]"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions