cooperl22 / laravel-db2

laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.
Other
59 stars 65 forks source link

Undefined index: aggregate #1

Closed jbh closed 8 years ago

jbh commented 9 years ago

Hi there. I'm trying to get this to work with DB2 currently, and I keep getting this error from artisan:

  [ErrorException]            
  Undefined index: aggregate  

Exception trace:
 () at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1649
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1649
 Illuminate\Database\Query\Builder->aggregate() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1596
 Illuminate\Database\Query\Builder->max() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:105
 Illuminate\Database\Migrations\DatabaseMigrationRepository->getLastBatchNumber() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:95
 Illuminate\Database\Migrations\DatabaseMigrationRepository->getNextBatchNumber() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:104
 Illuminate\Database\Migrations\Migrator->runMigrationList() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:82
 Illuminate\Database\Migrations\Migrator->run() at /www/october/htdocs/modules/system/Classes/UpdateManager.php:351
 System\Classes\UpdateManager->migrateModule() at /www/october/htdocs/modules/system/Classes/UpdateManager.php:132
 System\Classes\UpdateManager->update() at /www/october/htdocs/modules/system/Console/OctoberUp.php:34
 System\Console\OctoberUp->fire() at n/a:n/a
 call_user_func_array() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php:523
 Illuminate\Container\Container->call() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php:115
 Illuminate\Console\Command->execute() at /www/october/htdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php:101
 Illuminate\Console\Command->run() at /www/october/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /www/october/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /www/october/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /www/october/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:94
 Illuminate\Foundation\Console\Kernel->handle() at /www/october/htdocs/artisan:36

Any ideas? This is for an AS400 running DB2 v7.1.

I realize that that is outdated, but I checked the grammars, and I don't believe that is part of the issue.

cooperl22 commented 9 years ago

Hi.

What OS is hosting your code right now?

First this package is made for Laravel Framework. I don't know OctoberCMS. Even if it is based on Laravel I don't know again how to extend database module of this CMS.

Plus you have to know that for now pdo_ibm doesn't work well on IBMi so you can't make it work natively on IBMi. I'm working on it with Zend and IBM. So my package work only with ODBC. Here I have a webapp running under Windows Server very well. I didn't test with unixODBC but it should.

Now the thing is that in your error stack message I don't see anything from my package. What did you do exactly?

jbh commented 9 years ago

Sorry, here are more details:

As far as an OS goes, it's just the AS400 running with AIX. It's an iSeries, which is separate from their LUW products.

I realize that it is for Laravel. I just assumed since OctoberCMS was built on vanilla Laravel, using Illuminate, that this plugin would be compatible. I'll try testing the plugin with just Laravel today and see how it goes.

Also, we are using Zend Server as you mentioned. We have been able to successfully use Doctrine as a DBAL with just DB2 calls and not ODBC, so Symfony is a viable option, but I was really stoked when I heard about a Laravel solution, so I wanted to give it a shot. I can try out the ODBC maybe, but I'm not sure how to get an ODBC driver running on an iSeries. I could look into that also.

I am calling php artisan october:up, which just seeds the database like db:seed does, but with OctoberCMS data. I realize you're not here to debug October, and I'm not asking you to, but any help would be awesome. I'll try just Laravel today and give you an update on how that goes.

cooperl22 commented 9 years ago

Actually my package should work as it with Laravel (Really don't know for OctoberCMS but why not) running with Zend Server for IBMi. The thing is that it relies on PDO database access. That's why it works only with PDO_ODBC or PDO_IBM. In fact most of PHP frameworks use PDO.

As I said PDO_IBM is broken on IBMi (Zend Server). I'm waiting from them a fix. A fix exists => http://youngiprofessionals.com/wiki/index.php/XMLService/PHPPDOChangeLog The major issue I'm faced to is "- odd problem in column names" and they, he, she fixed it.

So I have a case opened at Zend. I'm waiting a new PDO_IBM.so library compiled for Zend Server for IBMi. Then I test it.

Doctrine uses ibm_db2 driver. This latter is not broken on IBMi. That's why you could make it work.

This issue made us host our website on Windows/Apache but I have good hope that we can migrate it on Zend Server for IBMi as soon as they fix PDO_IBM driver.

About OctoberCMS i'll try to have a look on it as soon as I have time ;-) Could you ask them in the same time how we can extend database access with their CMS. For instance there are also other packages for Laravel which add MongoDB support.

jbh commented 9 years ago

Oh, that's great! Thanks for that link. I will talk to some developers in the OctoberCMS IRC and relay the information.