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 response for POST /sensors/:id and GET /sensors/:id/data methods in sensorResource #4

Closed
priyapappachan opened this issue Mar 16, 2017 · 5 comments

Comments

@priyapappachan
Copy link
Contributor

I used the following command for retrieving the data using REST endpoint
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer <access_token>' 'http://127.0.0.1:8080/api/sensors/1/data'

I got the following response {
"message": "error.internalServerError",
"description": "Internal server error",
"fieldErrors": null
}

The same error occurs for POST http://127.0.0.1:8080/api//sensors/:id. The sensor with id 1 is present.

@priyapappachan priyapappachan changed the title POST /sensors/:id and GET /sensors/:id/data in sensorResource not working Internal Server error response for POST /sensors/:id and GET /sensors/:id/data methods in sensorResource Mar 16, 2017
@tharidu
Copy link
Contributor

tharidu commented Mar 18, 2017

I guess it failed to create the correspending Cassandra table in 'ioe' keyspace. Can you check through web interface whether the created sensor is shown?

@priyapappachan
Copy link
Contributor Author

priyapappachan commented Mar 18, 2017

Yes, the created sensor with id 1 is shown in the web interface under sensors tab. When I was creating new sensor I got 'Internal server error' when clicked on 'Save'. But the created sensor is shown in the sensors list after a refresh.

@tharidu
Copy link
Contributor

tharidu commented Mar 19, 2017

It's better if you can confirm in the keyspace in Cassandra has been created successfully using a client (ex DataStax client). Can you try to create another sensor with Store type field as NORMAL ?

In the new sensor UI, ideally com.scorelab.ioe.nosql.StoreTypes enum type should be mapped to Store type field as a combo box. You can do it as a task if you like to get to know the codebase.

@priyapappachan
Copy link
Contributor Author

The problem was with the StoreType field value. The table data_x is getting created when a new sensor is created. I am able to perform POST /sensors/:id and GET /sensors/:id/data methods in sensorResource now. But there are no other tables created in keyspace for device and sensor data entries done using the interface.

@tharidu
Copy link
Contributor

tharidu commented Mar 19, 2017

Cassandra data store only handles sensor data because of its scalability properties. Details about sensor and device information are stored in MySQL DB in the docker setup. This is done because relation DB does a better job of keeping these data compared to NoSQL.

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

2 participants