gyselroth / tubee

Data management engine with synchronization support
GNU General Public License v3.0
4 stars 4 forks source link

Do not throw an exception during query for an non existing mssql field #38

Closed raffis closed 5 years ago

raffis commented 5 years ago

Describe the bug

Query an mssql endpoint should not end in an exception if a non existing field was given:

[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "2019-22-05 08:21:10 [Tubee\Rest\Middlewares\ExceptionHandler,ERROR]: uncaught exception failed to execute sql query with error [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'PersonID'. (42S22)]  [object] (Tubee\Endpoint\Pdo\Exception\InvalidQuery(code: 0): failed to execute sql query with error [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'PersonID'. (42S22) at /usr/share/tubee/src/lib/Endpoint/Pdo/Wrapper.php:89)"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "[stacktrace]"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#0 /usr/share/tubee/src/lib/Endpoint/Pdo.php(53): Tubee\Endpoint\Pdo\Wrapper->select('SELECT * FROM v...')"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#1 /usr/share/tubee/src/lib/Acl.php(143): Tubee\Endpoint\Pdo->getAll(Array, 0, 20, Array)"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#2 /usr/share/tubee/src/lib/Rest/Pager.php(34): Tubee\Acl->filterOutput(Object(Zend\Diactoros\ServerRequest), Object(Micro\Auth\Identity), Object(Generator))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#3 /usr/share/tubee/src/lib/Rest/Helper.php(42): Tubee\Rest\Pager::fromRequest(Object(Generator), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#4 /usr/share/tubee/src/lib/Rest/v1/Endpoints.php(171): Tubee\Rest\Helper::getAll(Object(Zend\Diactoros\ServerRequest), Object(Micro\Auth\Identity), Object(Tubee\Acl), Object(Generator))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#5 [internal function]: Tubee\Rest\v1\Endpoints->getAllObjects(Object(Zend\Diactoros\ServerRequest), Object(Micro\Auth\Identity), 'kzn', 'accounts', Object(Tubee\Endpoint\Pdo))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#6 /usr/share/tubee/src/lib/Rest/Middlewares/RequestHandler.php(77): call_user_func_array(Array, Array)"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#7 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Tubee\Rest\Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#8 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#9 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#10 /usr/share/tubee/vendor/middlewares/trailing-slash/src/TrailingSlash.php(54): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#11 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Middlewares\TrailingSlash->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#12 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#13 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#14 /usr/share/tubee/src/lib/Rest/Middlewares/Acl.php(51): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#15 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Tubee\Rest\Middlewares\Acl->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#16 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#17 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#18 /usr/share/tubee/vendor/gyselroth/micro-auth/src/Middleware/Auth.php(59): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#19 /usr/share/tubee/src/lib/Rest/Middlewares/Auth.php(32): Micro\Auth\Middleware\Auth->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#20 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Tubee\Rest\Middlewares\Auth->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#21 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#22 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#23 /usr/share/tubee/vendor/middlewares/fast-route/src/FastRoute.php(64): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#24 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Middlewares\FastRoute->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#25 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#26 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#27 /usr/share/tubee/src/lib/Rest/Middlewares/QueryDecoder.php(72): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#28 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Tubee\Rest\Middlewares\QueryDecoder->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#29 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#30 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#31 /usr/share/tubee/vendor/middlewares/payload/src/Payload.php(75): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#32 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Middlewares\Payload->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#33 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#34 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#35 /usr/share/tubee/src/lib/Rest/Middlewares/ExceptionHandler.php(57): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#36 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Tubee\Rest\Middlewares\ExceptionHandler->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#37 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#38 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#39 /usr/share/tubee/vendor/middlewares/access-log/src/AccessLog.php(115): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#40 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Middlewares\AccessLog->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#41 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#42 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#43 /usr/share/tubee/vendor/middlewares/negotiation/src/ContentType.php(107): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#44 /usr/share/tubee/vendor/lcobucci/content-negotiation-middleware/src/ContentTypeMiddleware.php(73): Middlewares\ContentType->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#45 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(94): Lcobucci\ContentNegotiation\ContentTypeMiddleware->process(Object(Zend\Diactoros\ServerRequest), Object(mindplay\middleman\Delegate))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#46 [internal function]: mindplay\middleman\Dispatcher->mindplay\middleman\{closure}(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#47 /usr/share/tubee/vendor/mindplay/middleman/src/Delegate.php(38): call_user_func(Object(Closure), Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#48 /usr/share/tubee/vendor/mindplay/middleman/src/Dispatcher.php(59): mindplay\middleman\Delegate->handle(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#49 /usr/share/tubee/bin/httpdocs/index.php(44): mindplay\middleman\Dispatcher->dispatch(Object(Zend\Diactoros\ServerRequest))"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: "#50 {main}"
[22-May-2019 08:21:10] WARNING: [pool www] child 213 said into stdout: ""

To Reproduce

  1. Create mssql endpoint
  2. Do a query with a non existing field

Expected behavior

Log exception and return an empty generator.

Environment

Additional context

Add any other context about the problem here.