Closed tahnil closed 9 years ago
Added a screenshot, see above.
Can you check the api table? Is it empty?
And how did you generate the database tables? With doctrine migrations of schema update?
Table ”api“ is empty, and I created the tables via schema update. Was that wrong?
By the way, I'm totally new to this, and I'm only a hobby developer, who's basically terrible at everything. Therefore I might have done everything wrong. I wanted to test the cronjob, and in order to do so I manually inserted the API key data into the database.
After having a closer look at the entities I wondered if I should have used the class ApiKey from ApiKey.php in a short script to insert the first API key. Is that right?
No worries, I'm glad for anyone willing to try it out and get it going. Drop your tables and try running
app/console help doctrine:migrations:migrate
this should hopefully create the tables and add the necessary base data (which you're lacking, which is the issue you're getting).
Manually entering data into the api key table like you did should be fine.
If that helps I'll then also update the readme so the next one will know how to setup the database.
Looks better, but I'm running into an error:
Migration 20140101153008 failed during Execution. Error An exception occurred while executing 'ALTER TABLE corpIndustryJob ADD PRIMARY KEY (ID)':
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined
[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing 'ALTER TABLE corpIndustryJob ADD PRIMARY KEY (ID)':
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined
Ok, when I omit the last two migrations everything seems to work quite fine, but of course the gearman worker fails at the industry jobs table. So I think there might be a problem with the second last migration file.
I think I fixed the problem by uncommenting line 24 of the failed migration file. After that the migrations worked.
Afterwards I ran into a new problem when I manually ran the gearman worker:
/usr/bin/php /var/www/vhosts/Symfony/app/console gearman:worker:execute TariochEveapiFetcherEveWorker --env=prod --no-interaction
The SQL inserts into corpWalletJournal seem to fail: ”Integrity constraint violation: 1062 Duplicate entry '
can you manually change that index to be ower ownerID and accountKey?
I tried that, but it doesn‘t seem to help. Here a screenshot of the keys of corpWalletJournal:
sorry, forgot, you also need to add ref id: should look like that:
Oh, wow. Now the table gets populated, but I get a new error message, unrelated to corpWalletJournal :-D
PHP Notice: Undefined index: assemblyLineID in /var/www/vhosts/Symfony/vendor/3rdpartyeve/phealng/lib/Pheal/Core/RowSetRow.php on line 66
(some Stack trace)
PHP Notice: Undefined index: containerID in /var/www/vhosts/Symfony/vendor/3rdpartyeve/phealng/lib/Pheal/Core/RowSetRow.php on line 66
Etc for like every column in table corpIndustryJob. Error message says:
[Doctrine\DBAL\Exception\NotNullConstraintViolationException]
An exception occurred while executing 'INSERT INTO corpIndustryJob (jobID, ownerID, assemblyLineID, containerID, containerLocationID, containerTypeID, installedInSolarSystemID, installedItemCopy, installedItemID, installedItemLocationID, installedIte
mQuantity, installedItemTypeID, installerID, outputLocationID, outputTypeID, runs, licensedProductionRuns, installedItemMaterialLevel, installedItemProductivityLevel, installedItemLicensedProductionRunsRemaining, beginProductionTime, endProductionTim
e, installTime, pauseProductionTime, completed, activityID, completedStatus, completedSuccessfully, installedItemFlag, outputFlag, materialMultiplier, charMaterialMultiplier, charTimeMultiplier, timeMultiplier) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["251752910", "98078057", null, null, null, null, null, null, null, null, null, null, "90614472", "1011907005842", null, "1", null, null, null, null, "2015-01-01 17:4
5:00", "2015-01-01 17:45:00", "2015-01-01 17:45:00", "2015-01-01 17:45:00", 0, "1", null, null, null, null, null, null, null, null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'assemblyLineID' cannot be null
I think there‘s something wrong with the processing of the API call. There shouldn‘t be all those NULL values.
Maybe it helps to include the complete Stack trace for at least one of the "undefined index" error messages, because I‘m kinda stuck here:
PHP Stack trace:
PHP 1. {main}() /var/www/vhosts/Symfony/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /var/www/vhosts/Symfony/app/console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/vhosts/Symfony/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:124
PHP 4. Symfony\Component\Console\Application->doRun() /var/www/vhosts/Symfony/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
PHP 5. Symfony\Component\Console\Application->doRunCommand() /var/www/vhosts/Symfony/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:193
PHP 6. Symfony\Component\Console\Command\Command->run() /var/www/vhosts/Symfony/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:896
PHP 7. Mmoreram\GearmanBundle\Command\GearmanWorkerExecuteCommand->execute() /var/www/vhosts/Symfony/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:252
PHP 8. Mmoreram\GearmanBundle\Service\GearmanExecute->executeWorker() /var/www/vhosts/Symfony/vendor/mmoreram/gearman-bundle/Mmoreram/GearmanBundle/Command/GearmanWorkerExecuteCommand.php:187
PHP 9. Mmoreram\GearmanBundle\Service\GearmanExecute->callJob() /var/www/vhosts/Symfony/vendor/mmoreram/gearman-bundle/Mmoreram/GearmanBundle/Service/GearmanExecute.php:272
PHP 10. Mmoreram\GearmanBundle\Service\GearmanExecute->runJob() /var/www/vhosts/Symfony/vendor/mmoreram/gearman-bundle/Mmoreram/GearmanBundle/Service/GearmanExecute.php:137
PHP 11. GearmanWorker->work() /var/www/vhosts/Symfony/vendor/mmoreram/gearman-bundle/Mmoreram/GearmanBundle/Service/GearmanExecute.php:216
PHP 12. Tarioch\EveapiFetcherBundle\Component\Worker\EveWorker->apiUpdate() /var/www/vhosts/Symfony/vendor/mmoreram/gearman-bundle/Mmoreram/GearmanBundle/Service/GearmanExecute.php:216
PHP 13. Tarioch\EveapiFetcherBundle\Component\Worker\ApiUpdater->update() /var/www/vhosts/Symfony/vendor/tarioch/eveapi-fetcher-bundle/Tarioch/EveapiFetcherBundle/Component/Worker/EveWorker.php:44
PHP 14. Tarioch\EveapiFetcherBundle\Component\Section\KeySectionApi->update() /var/www/vhosts/Symfony/vendor/tarioch/eveapi-fetcher-bundle/Tarioch/EveapiFetcherBundle/Component/Worker/ApiUpdater.php:56
PHP 15. Tarioch\EveapiFetcherBundle\Component\EveApi\Corp\IndustryJobUpdater->update() /var/www/vhosts/Symfony/vendor/tarioch/eveapi-fetcher-bundle/Tarioch/EveapiFetcherBundle/Component/Section/KeySectionApi.php:46
PHP 16. Pheal\Core\RowSetRow->__get() /var/www/vhosts/Symfony/vendor/tarioch/eveapi-fetcher-bundle/Tarioch/EveapiFetcherBundle/Component/Section/KeySectionApi.php:60
yeah, I didn't get around to actually update the call for that api as I'm currently not actually using it, if you don't need it, you can remove the api from the api table for the industry call so you don't get the error
Unfortunate, cause that‘s kinda interesting to have. But in order to see what‘s happening I‘ll deactivate it for the time being.
Do you think you could catch those kinds of errors instead of a fatal / critical exception?
As each api call itself is running independent of the others, I'd rather prefer for it to fail instead of missing such issues.
It shouldn't be too hard to actually fix the error/adjust the api, you can have a look at IndustryJobUpdater.php and https://neweden-dev.com/Char/IndustryJobs if you're interested.
I will have a look at it.
But at the same time I think I‘m missing a point here. Because how can it be that the (manually) started gearman worker stopped with above mentioned error? Or didn‘t it stop at all? I have no experience with gearman.
No actually you're right, I'm running it with supervisord, that's why a failing job doesn't matter to me, but it would be better to log the issue as fatal and let the job still continue. I created #9 for this.
I created a pull request for the industry thing.
EDIT: But now I‘m getting the Integrity constraint violation error (1062 Duplicate entry for key 'job_owner') for the corpIndustryJob table :-/ The table gets nicely populated though.
Thanks for the pull request, just merged it. I'm going to hopefully try to fix the migrations files for all the missing changes. (I might have done some changes locally instead of using the migrations, have to be more careful)
Great! Issue solved (for me at least).
I managed to install the bundle and all dependencies, but now schedule doesn‘t seem to work. I inserted a single API key into table "apiKey" and ran the console command:
Here‘s the API-Key entry:
Any ideas what I could be doing wrong?