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

Returns 500 when querying historic for non existing entity type #435

Open
gobaldia opened this issue Apr 6, 2018 · 3 comments
Open

Returns 500 when querying historic for non existing entity type #435

gobaldia opened this issue Apr 6, 2018 · 3 comments
Labels

Comments

@gobaldia
Copy link

gobaldia commented Apr 6, 2018

When asking STH API for return historic information for non existing entity type, it returns

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

The request I'm making is as follows (where someEntityType is a not existing entity type):

curl -X GET \
  'sth-host/STH/v1/contextEntities/type/someEntityType/id/d1/attributes/Temperature?aggrMethod=sum&aggrPeriod=hour&lastN=10' \
  -H 'Fiware-Service: antel' \
  -H 'Fiware-ServicePath: /auto'

I think it should return 404.

@AlvaroVega
Copy link
Member

AlvaroVega commented May 10, 2018

Sorry but I'm not able to reproduce it.

But I've got the following in traces:

iot-sth                     | time=2018-05-10T09:43:13.301Z | lvl=WARN | corr=0388645f-3cb3-4982-af34-2f9a7a259ba2 | trans=0388645f-3cb3-4982-af34-2f9a7a259ba2 | op=OPER_STH_GET | from=n/a | srv=smartcity | subsrv=/ | comp=STH | msg=Error when getting the raw data collection for retrieval (the collection may not exist)

It seems that in your case collection exits but data are right

@AlvaroVega AlvaroVega added the bug label Oct 30, 2018
@YatinArora-NEC
Copy link
Contributor

Hi @AlvaroVega

I am getting the same result as mentioned by you but as per my understanding 404 should be returned if an entity doesn't exists. Could you please confirm whether my understanding is correct or not?

@fgalan
Copy link
Member

fgalan commented Jun 20, 2019

I'm also unable to reproduce the bug. When I ask for nonexisting type I get a 200 OK with empty results, not a 500 (is 200 a good idea in this case? we are discussing it in a separate issue: #511)

Thus @gobaldia maybe you have some other kind of problem. Maybe the connection from STH to MongoDB is failing. Did you get in the log a message as the one @AlvaroVega cites?

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

No branches or pull requests

4 participants