Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error whilst testing HTTP requests #155

Open
medic-code opened this issue Dec 4, 2022 · 2 comments
Open

Internal Server Error whilst testing HTTP requests #155

medic-code opened this issue Dec 4, 2022 · 2 comments

Comments

@medic-code
Copy link
Contributor

medic-code commented Dec 4, 2022

I'm getting a status 500 error despite running the docker container and the seed data is in the database. I've been using VS Code REST Client to send real HTTP requests within VS Code as a way to get a feel for the API endpoints.

Environment
OS: Windows 10 Pro Version 22H2 OS Build 19045.2251
IDE: VS Code Version 1.73.0
Docker: Docker Desktop 4.15.0 (93002)

Steps to reproduce

  1. Use VS Code
  2. Install REST Client https://marketplace.visualstudio.com/items?itemName=humao.rest-client
  3. Clone repo and follow readme instructions
  4. Run dev server npm run dev
  5. Run docker container using npm run start-docker-postgres
    Seed data:
    image
  6. Create signup.rest file with the below
POST http://localhost:3001/api/users
Content-Type: application/json

{
    "username": "test user",
    "password": "12345",
    "email": "[email protected]",
    "knownLanguageId": "de",
    "learnLanguageId": "fr",
}
  1. Press 'send request' on signup.rest file

image

Actual Result:

HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 106
ETag: W/"6a-gCklfnms/BiQVKxCNQatNMNsdUI"
Date: Sun, 04 Dec 2022 22:10:31 GMT
Connection: close

{
  "error": {
    "statusCode": 500,
    "error": "Internal Server Error",
    "message": "An internal server error occurred"
  }
}

Expected Result

Status code 201 with sanitised user object

Other steps taken

I've tried running the dev,staging, prod server and still getting a status 500, restarted the docker container. Just wondering if there's something else I'm missing here ?

I was doing this as I wasn't quite sure where the status code 406 comes from when looking at the tests when someone tries to signup with a email address already signed up. I couldn't find the 406 status within the services code logic.

@eamon0989
Copy link
Contributor

I am running into this issue when trying to create a new user locally. There is a comment in the users routes that says investigate issue with incorrect credentials for sendgrid causing a 500 error, so it seems to be something to do with sendgrid. Maybe @mrchrmn knows something more about this issue?

@mrchrmn
Copy link
Member

mrchrmn commented Mar 28, 2023

Two comments, not sure if helpful.

  • The email verification step only works with a valid API key for Sendgrid.
  • The 406 errors come from throwing the NotAcceptable on various occasions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants