Skip to content

Can't see existing devices or creating new ones after upgrade

After upgrading to the latest version of Nextcloud (14) I can't access to Phonetrack anymore. Today I've been prompted about an app update and I immediately upgraded to 0.3.4. Since the phonetrack upgrade, I can open again the interface but I can't see my devices and datapoints.

NOTE: it doesn't look related to: #82 (closed)

This is the query that's failing:

SELECT
  oc_phonetrack_proxims.id AS id,
  deviceid2,
  lowlimit,
  highlimit,
  urlclose,
  urlfar,
  urlclosepost,
  urlfarpost,
  sendemail,
  oc_phonetrack_devices.name AS dname2,
  oc_phonetrack_sessions.name AS sname2
  FROM
    oc_phonetrack_proxims
    INNER JOIN
      oc_phonetrack_devices
    INNER JOIN
      oc_phonetrack_sessions
    WHERE
      deviceid1='1'
      AND deviceid2=oc_phonetrack_devices.id
      AND oc_phonetrack_devices.sessionid=oc_phonetrack_sessions.token
;

And the log entry:

{
  "reqId": "********************",
  "level": 3,
  "time": "2018-10-11T01:40:14+00:00",
  "remoteAddr": "1.2.3.4",
  "user": "john",
  "app": "index",
  "method": "POST",
  "url": "\/index.php\/apps\/phonetrack\/getSessions",
  "message": {
    "Exception": "Doctrine\\DBAL\\Exception\\SyntaxErrorException",
    "Message": "An exception occurred while executing 'SELECT oc_phonetrack_proxims.id AS id, deviceid2, lowlimit, highlimit, urlclose, urlfar, urlclosepost, urlfarpost, sendemail, oc_phonetrack_devices.name AS dname2, oc_phonetrack_sessions.name AS sname2 FROM oc_phonetrack_proxims INNER JOIN oc_phonetrack_devices INNER JOIN oc_phonetrack_sessions WHERE deviceid1='1' AND deviceid2=oc_phonetrack_devices.id AND oc_phonetrack_devices.sessionid=oc_phonetrack_sessions.token ;':\n\nSQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^",
    "Code": 0,
    "Trace": [{
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php",
      "line": 128,
      "function": "convertException",
      "class": "Doctrine\\DBAL\\Driver\\AbstractPostgreSQLDriver",
      "type": "->",
      "args": ["An exception occurred while executing 'SELECT oc_phonetrack_proxims.id AS id, deviceid2, lowlimit, highlimit, urlclose, urlfar, urlclosepost, urlfarpost, sendemail, oc_phonetrack_devices.name AS dname2, oc_phonetrack_sessions.name AS sname2 FROM oc_phonetrack_proxims INNER JOIN oc_phonetrack_devices INNER JOIN oc_phonetrack_sessions WHERE deviceid1='1' AND deviceid2=oc_phonetrack_devices.id AND oc_phonetrack_devices.sessionid=oc_phonetrack_sessions.token ;':\n\nSQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^", {
        "errorInfo": ["42601", 7, "ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^"],
        "__class__": "Doctrine\\DBAL\\Driver\\PDOException"
      }]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php",
      "line": 177,
      "function": "driverExceptionDuringQuery",
      "class": "Doctrine\\DBAL\\DBALException",
      "type": "::",
      "args": [{
        "__class__": "Doctrine\\DBAL\\Driver\\PDOPgSql\\Driver"
      }, {
        "errorInfo": ["42601", 7, "ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^"],
        "__class__": "Doctrine\\DBAL\\Driver\\PDOException"
      }, "SELECT oc_phonetrack_proxims.id AS id, deviceid2, lowlimit, highlimit, urlclose, urlfar, urlclosepost, urlfarpost, sendemail, oc_phonetrack_devices.name AS dname2, oc_phonetrack_sessions.name AS sname2 FROM oc_phonetrack_proxims INNER JOIN oc_phonetrack_devices INNER JOIN oc_phonetrack_sessions WHERE deviceid1='1' AND deviceid2=oc_phonetrack_devices.id AND oc_phonetrack_devices.sessionid=oc_phonetrack_sessions.token ;", []]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
      "line": 1775,
      "function": "execute",
      "class": "Doctrine\\DBAL\\Statement",
      "type": "->",
      "args": []
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
      "line": 371,
      "function": "getProxims",
      "class": "OCA\\PhoneTrack\\Controller\\PageController",
      "type": "->",
      "args": [1]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
      "line": 324,
      "function": "getDevices",
      "class": "OCA\\PhoneTrack\\Controller\\PageController",
      "type": "->",
      "args": ["********************************"]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
      "line": 166,
      "function": "getSessions",
      "class": "OCA\\PhoneTrack\\Controller\\PageController",
      "type": "->",
      "args": []
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
      "line": 99,
      "function": "executeController",
      "class": "OC\\AppFramework\\Http\\Dispatcher",
      "type": "->",
      "args": [{
        "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
      }, "getSessions"]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/App.php",
      "line": 118,
      "function": "dispatch",
      "class": "OC\\AppFramework\\Http\\Dispatcher",
      "type": "->",
      "args": [{
        "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
      }, "getSessions"]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php",
      "line": 47,
      "function": "main",
      "class": "OC\\AppFramework\\App",
      "type": "::",
      "args": ["PageController", "getSessions", {
        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
      }, {
        "_route": "phonetrack.page.getSessions"
      }]
    }, {
      "function": "__invoke",
      "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
      "type": "->",
      "args": [{
        "_route": "phonetrack.page.getSessions"
      }]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/Route\/Router.php",
      "line": 297,
      "function": "call_user_func",
      "args": [{
        "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
      }, {
        "_route": "phonetrack.page.getSessions"
      }]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/base.php",
      "line": 987,
      "function": "match",
      "class": "OC\\Route\\Router",
      "type": "->",
      "args": ["\/apps\/phonetrack\/getSessions"]
    }, {
      "file": "\/usr\/share\/nginx\/html\/nextcloud\/index.php",
      "line": 42,
      "function": "handleRequest",
      "class": "OC",
      "type": "::",
      "args": []
    }],
    "File": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractPostgreSQLDriver.php",
    "Line": 67,
    "Previous": {
      "Exception": "Doctrine\\DBAL\\Driver\\PDOException",
      "Message": "SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^",
      "Code": "42601",
      "Trace": [{
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php",
        "line": 168,
        "function": "execute",
        "class": "Doctrine\\DBAL\\Driver\\PDOStatement",
        "type": "->",
        "args": [null]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
        "line": 1775,
        "function": "execute",
        "class": "Doctrine\\DBAL\\Statement",
        "type": "->",
        "args": []
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
        "line": 371,
        "function": "getProxims",
        "class": "OCA\\PhoneTrack\\Controller\\PageController",
        "type": "->",
        "args": [1]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
        "line": 324,
        "function": "getDevices",
        "class": "OCA\\PhoneTrack\\Controller\\PageController",
        "type": "->",
        "args": ["82b12c0517cf6296986be98b6a756e3d"]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
        "line": 166,
        "function": "getSessions",
        "class": "OCA\\PhoneTrack\\Controller\\PageController",
        "type": "->",
        "args": []
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
        "line": 99,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [{
          "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
        }, "getSessions"]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/App.php",
        "line": 118,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [{
          "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
        }, "getSessions"]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php",
        "line": 47,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": ["PageController", "getSessions", {
          "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
        }, {
          "_route": "phonetrack.page.getSessions"
        }]
      }, {
        "function": "__invoke",
        "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
        "type": "->",
        "args": [{
          "_route": "phonetrack.page.getSessions"
        }]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/Route\/Router.php",
        "line": 297,
        "function": "call_user_func",
        "args": [{
          "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
        }, {
          "_route": "phonetrack.page.getSessions"
        }]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/base.php",
        "line": 987,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": ["\/apps\/phonetrack\/getSessions"]
      }, {
        "file": "\/usr\/share\/nginx\/html\/nextcloud\/index.php",
        "line": 42,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }],
      "File": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php",
      "Line": 107,
      "Previous": {
        "Exception": "PDOException",
        "Message": "SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"WHERE\"\nLINE 1: ...netrack_devices INNER JOIN oc_phonetrack_sessions WHERE devi...\n                                                             ^",
        "Code": "42601",
        "Trace": [{
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php",
          "line": 105,
          "function": "execute",
          "class": "PDOStatement",
          "type": "->",
          "args": [null]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php",
          "line": 168,
          "function": "execute",
          "class": "Doctrine\\DBAL\\Driver\\PDOStatement",
          "type": "->",
          "args": [null]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
          "line": 1775,
          "function": "execute",
          "class": "Doctrine\\DBAL\\Statement",
          "type": "->",
          "args": []
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
          "line": 371,
          "function": "getProxims",
          "class": "OCA\\PhoneTrack\\Controller\\PageController",
          "type": "->",
          "args": [1]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/apps\/phonetrack\/controller\/pagecontroller.php",
          "line": 324,
          "function": "getDevices",
          "class": "OCA\\PhoneTrack\\Controller\\PageController",
          "type": "->",
          "args": ["********************************"]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
          "line": 166,
          "function": "getSessions",
          "class": "OCA\\PhoneTrack\\Controller\\PageController",
          "type": "->",
          "args": []
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php",
          "line": 99,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [{
            "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
          }, "getSessions"]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/App.php",
          "line": 118,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [{
            "__class__": "OCA\\PhoneTrack\\Controller\\PageController"
          }, "getSessions"]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php",
          "line": 47,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": ["PageController", "getSessions", {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          }, {
            "_route": "phonetrack.page.getSessions"
          }]
        }, {
          "function": "__invoke",
          "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
          "type": "->",
          "args": [{
            "_route": "phonetrack.page.getSessions"
          }]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/private\/Route\/Router.php",
          "line": 297,
          "function": "call_user_func",
          "args": [{
            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
          }, {
            "_route": "phonetrack.page.getSessions"
          }]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/lib\/base.php",
          "line": 987,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": ["\/apps\/phonetrack\/getSessions"]
        }, {
          "file": "\/usr\/share\/nginx\/html\/nextcloud\/index.php",
          "line": 42,
          "function": "handleRequest",
          "class": "OC",
          "type": "::",
          "args": []
        }],
        "File": "\/usr\/share\/nginx\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php",
        "Line": 105
      }
    },
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla\/5.0",
  "version": "14.0.1.1"
}