dreamfactorysoftware / dreamfactory

DreamFactory API Management Platform
https://www.dreamfactory.com
Apache License 2.0
1.56k stars 314 forks source link

MSSQL Tables not being found #9

Closed longrunningprocess closed 8 years ago

longrunningprocess commented 9 years ago

Swagger docs are bringing back all our tables but when trying to get data from one of those tables (again using the swagger docs), there is a strange failure about the API not being able to find the table (which was provided in the dropdown of tables within the swagger docs).

further details in http://community.dreamfactory.com/t/ms-sql-tables-being-returned-but-no-data-within-them-in-2-0/1639

hasansahmad commented 9 years ago

We are also experiencing this behavior with 2.0 beta 4 with Swagger as well as the API call testing tool. Below is the full error trace for just in case... is there a resolve already?

{ "error": { "context": null, "message": "Table "OrderOEStatus" does not exist in the database.", "code": 404, "trace": [ "0 [internal function]: DreamFactory\Core\Resources\BaseDbTableResource->handleGet()", "1 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Components\RestHandler.php(271): call_user_func(Array)", "2 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Components\RestHandler.php(177): DreamFactory\Core\Components\RestHandler->processRequest()", "3 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Components\RestHandler.php(224): DreamFactory\Core\Components\RestHandler->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), 'OrderOEStatus/1...')", "4 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Services\BaseDbService.php(116): DreamFactory\Core\Components\RestHandler->handleResource(Array)", "5 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Components\RestHandler.php(172): DreamFactory\Core\Services\BaseDbService->handleResource(Array)", "6 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Services\BaseRestService.php(65): DreamFactory\Core\Components\RestHandler->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), '_table/OrderOES...')", "7 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\dreamfactory\df-core\src\Utility\ServiceHandler.php(57): DreamFactory\Core\Services\BaseRestService->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), '_table/OrderOES...')", "8 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(17493): DreamFactory\Core\Utility\ServiceHandler::processRequest('v2', 'santmyer', '_table/OrderOES...')", "9 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(17458): DreamFactory\Http\Controllers\RestController->handleService('v2', 'Santmyer', '_table/OrderOES...')", "10 [internal function]: DreamFactory\Http\Controllers\RestController->handleGET('v2', 'Santmyer', '_table/OrderOES...')", "11 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(8766): call_user_func_array(Array, Array)", "12 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(8835): Illuminate\Routing\Controller->callAction('handleGET', Array)", "13 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(8815): Illuminate\Routing\ControllerDispatcher->call(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route), 'handleGET')", "14 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))", "15 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9472): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "16 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(17857): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "17 [internal function]: Dreamfactory\Http\Middleware\Limits->handle(Object(Illuminate\Http\Request), Object(Closure))", "18 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "19 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(17752): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "20 [internal function]: DreamFactory\Http\Middleware\AccessCheck->handle(Object(Illuminate\Http\Request), Object(Closure))", "21 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "22 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "23 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9454): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "24 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(8816): Illuminate\Pipeline\Pipeline->then(Object(Closure))", "25 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(8801): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'handleGET')", "26 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7755): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'DreamFactory\Ht...', 'handleGET')", "27 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7726): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request))", "28 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7379): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))", "29 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))", "30 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9472): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "31 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "32 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9454): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "33 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7380): Illuminate\Pipeline\Pipeline->then(Object(Closure))", "34 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7368): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))", "35 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(7353): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))", "36 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(2262): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))", "37 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))", "38 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9472): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "39 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\vendor\barryvdh\laravel-cors\src\HandleCors.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "40 [internal function]: Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))", "41 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "42 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(17836): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "43 [internal function]: DreamFactory\Http\Middleware\FirstUserCheck->handle(Object(Illuminate\Http\Request), Object(Closure))", "44 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "45 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(12789): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "46 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))", "47 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "48 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(11412): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "49 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))", "50 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "51 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(12530): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "52 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))", "53 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "54 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(12469): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "55 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))", "56 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "57 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(2936): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "58 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))", "59 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9464): call_user_func_array(Array, Array)", "60 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))", "61 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(9454): call_user_func(Object(Closure), Object(Illuminate\Http\Request))", "62 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(2209): Illuminate\Pipeline\Pipeline->then(Object(Closure))", "63 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\bootstrap\cache\compiled.php(2192): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))", "64 C:\Bitnami\dreamfactory-2.0.beta-4\apps\dreamfactory\htdocs\public\index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))", "65 {main}" ] } }

jstablesdf commented 9 years ago

I have worked to reproduce this with SQL Server 2008 R2 and the latest DreamFactory code but have not been able to encounter the issue. Tables are returned okay for me. Can you provide more detail on replicating your exact environment and calls so I can reproduce this issue?

hasansahmad commented 9 years ago

SQL Server 2008 R2 - Developer Edition - x64 Windows 7 Ultimate - x64 DreamFactory - 2.0 beta 4 Bitnami Stack - x86

Service Driver - MS SQL Server (via sqlsrv) Connection String - sqlsrv:Server=localhost,1433\sql2008;Database=Ascend_Santmyer_Cur Username - sa Password - **

Role Component - * Role Access - Get Requester - API

getTables() List - http://127.0.0.1:82/api/v2/Santmyer/_table - Works getProcs(), callStoredProc(), callStoredFunc() - Works

getRecords() - http://127.0.0.1:82/api/v2/Santmyer/_table/OrderOEStatus - Fails with error in last post. I created a stored procedure to select * from OrderOEStatus table and that works fine. Same thing happens on all other tables from the Swagger - API Docs page or from another client/tool like Chrome App - Postman

jstablesdf commented 9 years ago

OP for this issue is in a Linux environment. So the Windows environment using the sqlsrv driver may be different. I will have to test using both.

jstablesdf commented 8 years ago

1) Tested again and could not reproduce this from a Linux environment with dblib driver on latest master release 2.0.1 https://github.com/dreamfactorysoftware/dreamfactory/commit/a58248ddd8657ae2d0cdd3e9fa53919278605d41 So OP issue remains un-replicated.

2) I have connected to SQL Server 2008 R2 from a Bitnami 2.0.1-0 install in Windows 7. That has demonstrated a new bug I hadn't seen before, but not a 404 when calling a listed table.

longrunningprocess commented 8 years ago

FIXED!

I reviewed instructions here about additional packages needed for MSSQL support and noticed it had either changed or we missed it the first time we built our own image with those additional packages. We were only installing the php5-sybase but I just added php5-odbc freetds-common and the issue was resolved once the app came back up. I apologize if that hadn't changed and we simply missed it :-(.

@hasansahmad I hope this resolves it for you too.

jstablesdf commented 8 years ago

Closing issue as it's resolved as originally reported. If the additional Windows issue needs further work, please submit under a discrete issue.