dyne / reflow-os

Base scripts to run Reflow OS
7 stars 2 forks source link

Internal error on the login mutation #27

Closed theobat closed 2 years ago

theobat commented 2 years ago

I'm facing an internal server error when trying to login with my account in bonfire :

    ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for {:safe, "<!DOCTYPE html>\n<html lang=\"en\" class=\"dark\">\n<head>\n<meta charset=\"utf-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n<meta name=\"description\" content=\"Bonfire instance\">\n<meta name=\"keywords\" content=\"bonfire, fediverse\">\n<meta name=\"author\" content=\"Bonfire\">\n<title data-suffix=\" · Bonfire\">Error · Bonfire</title>\n<link phx-track-static rel='stylesheet' href='/css/bonfire.css'/>\n</head>\n\n<body id=\"layout-root\" class=\"bg-blueGray-50 dark:bg-gray-800\">\n<div data-phx-main=\"true\"><div id=\"layout-error\">\n<div class=\"\">\n<div class=\"flex flex-col mx-auto overflow-hidden lg:mt-4\">\n<div class=\"relative z-10 flex justify-between flex-shrink-0 h-16\">\n  <div class=\"flex items-center flex-shrink-0 lg:px-4\">\n    <a data-phx-link=\"redirect\" data-phx-link-state=\"push\" href=\"/\">\n      <div class=\"flex items-center px-4 py-2 rounded\">\n\n        <div class=\"w-10 h-10 bg-center bg-no-repeat bg-contain\" style=\"background-image: url(https://bonfirenetworks.org/img/bonfire.png)\"></div>\n      </div>\n    </a>\n\n    <div class=\"flex flex-1\">\n    </div>\n  </div>\n\n</div>\n</div>\n\n  <div class=\"container max-w-screen-lg mx-auto mt-6\">\n<div class=\"flex my-6 -mx-2\">\n<div class=\"w-3/5 px-2\">\n  <div class=\"\">\n      <div class=\"px-4 py-5 bg-white rounded-t-md sm:px-6\">\n        <div class=\"flex flex-wrap items-center justify-between -mt-2 -ml-4 sm:flex-no-wrap\">\n          <div class=\"mt-2 ml-4 prose\">\n            <h1 class=\"text-gray-900\">\nInternal Server Error\n            </h1>\n\n\n          </div>\n        </div>\n      </div>\n      <div class=\"py-5 mx-auto sm:px-6 lg:px-8\">\n     </div>\n  </div>\n</div>\n</div>\n  </div>\n</div>\n</div>\n</div>\n</html>\n"} of type Tuple, Jason.Encoder protocol must always be explicitly implemented. This protocol is implemented for the following type(s): Geo.Point, Geo.PointZ, Geo.LineStringZ, Geo.GeometryCollection, Geo.MultiPointZ, Geo.MultiPolygon, Geo.MultiPoint, Geo.MultiLineStringZ, Geo.PointM, Geo.PointZM, Geo.PolygonZ, Geo.MultiPolygonZ, Geo.LineString, Geo.Polygon, Geo.MultiLineString, Ecto.Schema.Metadata, Ecto.Association.NotLoaded, NaiveDateTime, Float, DateTime, Time, Integer, Date, Jason.Fragment, Atom, BitString, Decimal, Map, List, Any

The GraphQL Query being :

mutation login ($password: String!, $emailOrUsername: String!) {
  login(emailOrUsername: $emailOrUsername, password: $password) {
    currentUsername
    currentAccountId
    token
  }
}

And yet the agent for this user exists and other queries are not causing any problem :

Capture d’écran 2022-02-01 à 16 20 36
theobat commented 2 years ago

I've got more context in a later error message : ** (ArgumentError) cookie store expects conn.secret_key_base to be at least 64 bytes

Changing to a longer (64+ bytes) SECRET_KEY_BASE made the error go away