Skip to content

Sending email via sendgrid fails #4693

Open
@smokedsalmonbagel

Description

@smokedsalmonbagel

I put my api key into the cocalc admin settings and tried the forgot password email. It seems to fail with this message in the logs.

debug: send_email(to:[email protected]) -- sending email to [email protected] -- error = {
  "message": "Unauthorized",
  "code": 401,
  "response": {
    "headers": {
      "server": "nginx",
      "date": "Fri, 22 May 2020 04:37:01 GMT",
      "content-type": "application/json",
      "content-length": "116",
      "connection": "close",
      "access-control-allow-origin": "https://sendgrid.api-docs.io",
      "access-control-allow-methods": "POST",
      "access-control-allow-headers": "Authorization, Content-Type, On-behalf-of, x-sg-elas-acl",
      "access-control-max-age": "600",
      "x-no-cors-reason": "https://sendgrid.com/docs/Classroom/Basics/API/cors.html"
    },
    "body": {
      "errors": [
        {
          "message": "The provided authorization grant is invalid, expired, or revoked",
          "field": null,
          "help": null
        }
      ]
    }
  }
}

Is there a way to find and display the API key cocalc is using (or at least check its length) to make sure it is actually set? I think there might be a an issue with some of these email related settings saving properly... I also noticed the container needs to be restarted for some settings to take effect.

I tried sending via curl from within the container - that worked just fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions