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

Fix get-profile and get-all-sensors when missing link #379

Open
BenMatase opened this issue Apr 18, 2018 · 0 comments
Open

Fix get-profile and get-all-sensors when missing link #379

BenMatase opened this issue Apr 18, 2018 · 0 comments
Assignees
Milestone

Comments

@BenMatase
Copy link
Collaborator

For instance, when there is a missing device or a project, the entire endpoint crashes because it tries to make a DB call that looks like

2018-04-17 20:12:36,381 - api - ERROR - Couldn't execute query - b'SELECT * FROM project WHERE projectId IN ()'
Traceback (most recent call last):
  File "/nfs/unixspace/linux/accounts/courtesy/e/energyhill/public_html/Flower/backend/db.py", line 61, in exec_query
    cursor.execute(formatted_sql_string, param_tuple)
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 247, in execute
    res = self._query(query)
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 411, in _query
    rowcount = self._do_query(q)
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 374, in _do_query
    db.query(q)
  File "/usr/remote/anaconda-3.6/lib/python3.6/site-packages/MySQLdb/connections.py", line 292, in query
    _mysql.connection.query(self, query)
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1")
@BenMatase BenMatase self-assigned this Apr 18, 2018
@BenMatase BenMatase added this to the Sprint 6 milestone Apr 24, 2018
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

1 participant