These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Yapeal PHP API library (version 1.0.5)

First post
Author
Dragonaire
Here there be Dragons
#241 - 2012-02-15 01:50:31 UTC
Read INSTALL.md and just follow the instructions like a new install. You can skip to step to make the DB but when you run the one to create the tables it will update the existing one with your data in place. As always make sure you have a good backup of the DB in case something goes wrong Blink

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#242 - 2012-02-17 17:58:40 UTC  |  Edited by: Dragonaire
Just a quick note for everyone. All the Wiki pages have been converted, updated and moved over to SourceForge now. Check them out at https://sourceforge.net/p/yapeal/wiki/Home/
You'll also notice the Wiki tab at Google Code now redirects you to them.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#243 - 2012-02-20 08:37:17 UTC  |  Edited by: Dragonaire
Ok everything for Yapeal can now be found on SourceForge.

For those of you that might have been cloning their Mercurial from Google Code you'll want to change to SourceForge as the one on Google isn't going to be updated in the future.

Also note for anyone else getting stuff from the SF site when the project was changed to SF Beta project all the URLs have changed so you'll either need to do a new clone of the project. Backup your config/ files and just wipe out your existing checkout and clone it again from the new URL.

Edit: Let me know if anything seems to be missing from the old site.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Elojs
White Cottage Holdings
#244 - 2012-02-22 02:42:48 UTC  |  Edited by: Elojs
Hey, Dragonaire,

After finally getting hardware upgraded, I return to a variety of new things. Installing yapeal again, I'm getting errors once installed, finding an uncaught exception. Below is the text displayed from my initial run of yapeal.php.

Quote:

C:\yapeal>php -f yapeal.php
2012-02-22 02:17:59.445
WARN: Insert/upsert failed for utilXmlCache
File: C:\yapeal\class\YapealQueryBuilder.php(489)
2012-02-22 02:17:59.495
WARN: mysqli error: [2006: MySQL server has gone away] in EXECUTE("truncate
table `eveAllianceList`")

Code: 2006
Trace:
#0 C:\yapeal\ext\ADOdb\adodb.inc.php(1042): adodb_throw('mysqli', 'EXECUTE', 200
6, 'MySQL server ha...', 'truncate table ...', false, Object(ADODB_mysqli))
#1 C:\yapeal\ext\ADOdb\adodb.inc.php(1017): ADOConnection->_Execute('truncate ta
ble ...', false)
#2 C:\yapeal\class\api\eve\eveAllianceList.php(188): ADOConnection->Execute('tru
ncate table ...')
#3 C:\yapeal\class\api\AApiRequest.php(112): eveAllianceList->prepareTables()
#4 C:\yapeal\class\SectionEve.php(113): AApiRequest->apiStore()
#5 C:\yapeal\yapeal.php(164): SectionEve->pullXML()
#6 {main}
--------- END TRACE ----------

File: C:\yapeal\class\api\eve\eveAllianceList.php(195)
2012-02-22 02:17:59.497
WARN: Could not prepare eveAllianceList API tables to accept new data for 0

File: C:\yapeal\class\api\AApiRequest.php(115)
2012-02-22 02:17:59.499
FATAL: Uncaught exception in yapeal.php
File: C:\yapeal\yapeal.php(183)
2012-02-22 02:17:59.500
FATAL: Failed to get ADOFieldObjects for columns in YapealQueryBuilder
Trace:
#0 C:\yapeal\class\api\eve\eveAllianceList.php(84): YapealQueryBuilder->__constr
uct('eveAllianceList', 'mysqli://yapeal...')
#1 C:\yapeal\class\api\AApiRequest.php(126): eveAllianceList->parserAPI()
#2 C:\yapeal\class\SectionEve.php(113): AApiRequest->apiStore()
#3 C:\yapeal\yapeal.php(164): SectionEve->pullXML()
#4 {main}
--------- END TRACE ----------

File: C:\yapeal\yapeal.php(184)

C:\yapeal>


What I did... What?

I installed my new API Key and vCode. I activated all sections in utilsections table. Then I ran the yapeal.php and received the above trace.

Do I need to correct anything? Or do you need further information? Or ...

Thanks in advance,
Elojs
Big smile
Mikokoel
Mining Industry Exile Foundation
Synergy of Steel
#245 - 2012-02-22 15:54:00 UTC
I'm not Dragonaire, but your error reminds me of some errors I got when using yapeal.

IIRC the main error is the "MySQL server has gone away" after the "Insert/upsert failed for utilXmlCache".
My guess would be that Yapeal creates to big SQL-Queries which your server can't process.

You could try to change the configuration of your server (somewhere in the my.ini), but I also think you can disable XML-Caching in the Yapeal configuration file

Hope that helps,

Mikokoel

Mikokoel | Head FC League of Unaligned Master Pilots

Dragonaire
Here there be Dragons
#246 - 2012-02-22 17:38:51 UTC
Mikokoel Is right sounds like you need to change your max_allowed_packet setting for MySQL. I would say yours is set below 1M or you are trying to run an older version of Yapeal before I put in some limits to the insert/upsert size that it uses. It now limits the size to 990k which is below the normal limit. You can find the constant that sets that at the bottom of class/YapealQueryBuilder.php. If you haven't yet you should read through the Starter Guide which on the Yapeal Settings page tells you more about changing the setting for MySQL.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Elojs
White Cottage Holdings
#247 - 2012-02-23 01:02:48 UTC  |  Edited by: Elojs
Quote:

IIRC the main error is the "MySQL server has gone away" after the "Insert/upsert failed for utilXmlCache".
My guess would be that Yapeal creates to big SQL-Queries which your server can't process.

You could try to change the configuration of your server (somewhere in the my.ini), but I also think you can disable XML-Caching in the Yapeal configuration file




Thanks, will look into that. The server hadn't gone away after all, just was slow responding. Need to tweak some settings in the XAMPP package (PHP, MySQL)

Appreciate the input.

Quote:

Mikokoel Is right sounds like you need to change your max_allowed_packet setting for MySQL. I would say yours is set below 1M or you are trying to run an older version of Yapeal before I put in some limits to the insert/upsert size that it uses. It now limits the size to 990k which is below the normal limit. You can find the constant that sets that at the bottom of class/YapealQueryBuilder.php. If you haven't yet you should read through the Starter Guide which on the Yapeal Settings page tells you more about changing the setting for MySQL.


Thanks, Dragonaire. I've read the starter guide. BTW, nice job on the Wiki. Looked through all that's there. Hoping to see it grow with Yapeal. XAMPP (which I'm using) is a non-standard install, so I have to track down the config files its using, and alter the appropriate setting in the right place. It's complicated by other sites using the XAMPP stack locally. Avoiding breaking any of them is my goal.

The main focus prompting the post was the 'untrapped' error that was reported for your review and whatever action you decide to take on it. Sorry if I didn't make that clear enough. Just responding to your request in the Yapeal Wiki.

FYI, I did have it working shorly after the post, and it's now polling for updates every hour under Task Scheduler. BTW, is the wiki postable? If so, I have a few thoughts for Windows installations to ease use. A two line command file named for some reason Yapeal.cmd to add the PHP and MySQL clients to the path, followed by the invocation of yapeal.php.

Thanks loads,
Elojs (Paul)
Satis Iqulenax
Free Imperial Vikings
#248 - 2012-02-23 03:22:54 UTC
Elojs wrote:
Thanks, Dragonaire. I've read the starter guide. BTW, nice job on the Wiki.

I would be the one taking the credit for this, since I was the one making the starter guide Roll but I also do understand the confusion since I haven't made any credit note on it, so I also don't mind that you are thanking Dragonaire P

Elojs wrote:
BTW, is the wiki postable? If so, I have a few thoughts for Windows installations to ease use. A two line command file named for some reason Yapeal.cmd to add the PHP and MySQL clients to the path, followed by the invocation of yapeal.php.

I'm almost sure it's only the developer/commiter that can make wikies, but you are welcome to add a comment to it or send it to Dragonaire or me, then we will look thou it and add it to the guide or a new wiki if it's usefull Big smile

Kind regards
Satis

Committer of Yapeal for Eve API. Developer of XMLSchema. A database schema tool for PHP

Dragonaire
Here there be Dragons
#249 - 2012-02-23 04:56:25 UTC
You can post to the wiki but you have to be authenticated (Be signed into SourceForge) to do so. General posts like that are moderated as well but I only set it up that way because of spambots P so please do add any comments or suggestion etc you have and one of us will make it visible for everyone (Once I figure out how that works anyway Blink) I may decided to change to just authenticated in the future but still getting use to the new system and I decided being a little bit on the paranoid side might not be a bad thing to start with Big smile

Satis Iqulenax does deserve the credit for the writing on the Starter Guide I just acted as editor on it and did the translation of the Wiki syntax during the move.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

The Magez
Deep Core Mining Inc.
Caldari State
#250 - 2012-02-23 20:19:53 UTC
Hello, i have this problem, i had an industry job that i cancelled ingame (Material Effiency job) and since then yapeal stopped fetching new corpIndustryJobs xml, or atleast its not putting it into database as it should, tried to truncate the table but its still not updating it, also tried to truncate another table (corpStandingsFromFactions) and that fetched fine even after truncated.

Thanks
PsyKzz
Republic Military School
Minmatar Republic
#251 - 2012-02-23 20:21:06 UTC
The Magez wrote:
Hello, i have this problem, i had an industry job that i cancelled ingame (Material Effiency job) and since then yapeal stopped fetching new corpIndustryJobs xml, or atleast its not putting it into database as it should, tried to truncate the table but its still not updating it, also tried to truncate another table (corpStandingsFromFactions) and that fetched fine even after truncated.

Thanks


Truncate means to empty.
It wont make a difference to how anything works.

Meh.

The Magez
Deep Core Mining Inc.
Caldari State
#252 - 2012-02-24 13:43:44 UTC  |  Edited by: The Magez
WARN: Deactivating Eve API: IndustryJobs for keyID: ****** as this API is no longer allowed by owner with this key
File: /var/www/eve/yapeal/class/api/ACorp.php(321)


So i found that line from the logs, didnt see it when i first time looked at the logs. I take it this means i have to activate the said api again? I tried manually to access the api with that key and it worked perfectly.
What possibly made that happen? I still have no other idea but the deleted job messing around with that thing somehow.


EDIT: Tried activating the corp api by using the wiki guide "Activating and deactivating APIs in a section" but still couldnt get it working.
Dragonaire
Here there be Dragons
#253 - 2012-02-24 18:07:20 UTC
At some point the API server thought that key had the IndustryJobs API turned off so when Yapeal was told that it unset the key and/or corp's bit so you'll need to update them not the general ones used by all of Yapeal. Look at the utilRegisteredCorporation and utilRegisteredKey tables that are related to the key that stopped working as the bitmap in activeAPIMask doesn't have the IndustryJobs bit set.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

The Magez
Deep Core Mining Inc.
Caldari State
#254 - 2012-02-25 13:30:40 UTC
Thanks! got it working again by updating the masks to include the industry jobs bit.
Zaepho
Goosewarms
Tactical Hunters and Gatherers
#255 - 2012-02-28 18:34:40 UTC
Dragonaire wrote:
At some point the API server thought that key had the IndustryJobs API turned off so when Yapeal was told that it unset the key and/or corp's bit so you'll need to update them not the general ones used by all of Yapeal. Look at the utilRegisteredCorporation and utilRegisteredKey tables that are related to the key that stopped working as the bitmap in activeAPIMask doesn't have the IndustryJobs bit set.


Would it make sense to have a field for desired and effective bit masks? This should allow for the desired mask to cover everything you want and effective to be updated via errors and the APIKeyInfo api. Effective would be used by all of the current classes. APIKeyInfo when processed would attempt to update the effective to be as close to the Desired as possible based on what the key itself supports.
Eduardo'o
Ministry of War
Amarr Empire
#256 - 2012-02-29 14:55:35 UTC
Dragonnaire,

I had a corp API for a character in my yapeal instance, i moved the character to another account, removed the api from the registeredKeys table and added the new api key for the accounts the character was moved to to the registeredKey instance.

The new data was picked up nicely, but the old data, belonging to the first api that I deleted keeps showing up. Is there something I forgot about when deleting the api in order to clean up the rest of the database?

Ed
Dragonaire
Here there be Dragons
#257 - 2012-02-29 17:10:31 UTC
Quote:
Would it make sense to have a field for desired and effective bit masks? This should allow for the desired mask to cover everything you want and effective to be updated via errors and the APIKeyInfo api. Effective would be used by all of the current classes. APIKeyInfo when processed would attempt to update the effective to be as close to the Desired as possible based on what the key itself supports.
Could something like that maybe be implemented? Yes, but not everyone wants the keys to change either. If you want that effect Yapeal supplies the tools for you to do so in a way that makes sense to your application. BTW you can get most of the effect you are looking for by simply setting the masks in utilSections and utilRegisteredKey to what you want and once accountAPIKeyInfo updates it will block any APIs that aren't allowed. If Yapeal tries getting an API before it updates that isn't allowed it deactivates it when the API server returns an error saying its not allowed like what was happening above. I've designed Yapeal to report error and then try to keep from repeatedly telling you there's an error or wasting time on something that doesn't work. You then as the programmer/user get to decide when whatever was causing the error has been fixed and it can try again.

Quote:
The new data was picked up nicely, but the old data, belonging to the first api that I deleted keeps showing up. Is there something I forgot about when deleting the api in order to clean up the rest of the database?
You didn't delete the old data from the API tables. Deleting the keys doesn't have any effect on the API tables themselves when it comes to existing data but only effects what new data may be added. Additionally when you do a character move like you did it would be a good idea to update the accountCharacters and accountKeyBridge tables manually or in your application to break the link between the key and the old account etc as how Yapeal well react in this case is not really defined. It should do the right things after accountAPIKeyInfo updates for the key but you may get a few errors until that has happened.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Drapko Nitzhonot
Abdera Logistics
#258 - 2012-03-15 12:30:12 UTC
Since long time ago I'm getting serveral "cron mails" per day with messages like:
Quote:
curl_error: Operation too slow. Less than 10 bytes/sec transfered the last 12 seconds
2012-03-12 20:00:42.981
INFO: Operation too slow. Less than 10 bytes/sec transfered the last 12 seconds for API https://api.eveonline.com/corp/WalletTransactions.xml.aspx
File: /home/drapko/doc/yapeal/class/YapealNetworkConnection.php(106)

or just:
Quote:
curl_error: Operation too slow. Less than 10 bytes/sec transfered the last 12 seconds

As everything were updated correctly, I didn't mind, but I can't believe I can't connect so many times to API every day and I wanted to decrease email notifies. (I don't want to redirect Yapeal to /dev/null in cron)

Another issue is Yapeal stopped updating corpWalletTransactions about 10 days ago. I notice my activeAPIMask was changed from utilRegisteredKey. I haven't touch any API key or Yapeal config since last Yapeal update (January 26th), so I don't know what happend to change that key... maybe because I'm getting so many curl_error?

Thanks
Dragonaire
Here there be Dragons
#259 - 2012-03-15 16:00:42 UTC
Drapko Nitzhonot - You have a couple options for the too slow errors.

  • B!tch at CCP because their servers aren't responding in a timely matter to API requests for some reason.
  • Change the error reporting level in Yapeal to 'warning' instead of 'info' inside the config/logger.xml file.
  • Change the timeout value in Yapeal to try giving them more time. You can try this by changing the last line
  • const TIMEOUT = 45;
    in ext/eac_httprequest.class.php. This probably won't help as most times when the API doesn't response in the time given it's not going to respond at all P

You also need to make sure there isn't another application trying to grab the same API information as they can conflict ending up with a race condition between them and the timeout errors.

Quote:
Another issue is Yapeal stopped updating corpWalletTransactions about 10 days ago. I notice my activeAPIMask was changed from utilRegisteredKey. I haven't touch any API key or Yapeal config since last Yapeal update (January 26th), so I don't know what happend to change that key... maybe because I'm getting so many curl_error?
Look for a line in your logs like this
WARN: Deactivating Eve API: WalletTransactions for keyID: ****** as this API is no longer allowed by owner with this key
I'll bet for what ever reason that Yapeal received an API error saying the key was not valid for that API and turned it off just like happened to The Magez above on IndustryJobs and the fix is the same as I gave to fix it.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Drapko Nitzhonot
Abdera Logistics
#260 - 2012-03-15 17:43:38 UTC
I will change to "warn". I missed the email about deactivating eve API because I was tired about same message :P

You are right, I have the log:
Quote:
2012-03-03 13:30:06.867
INFO: Deactivating Eve API: WalletTransactions for corporation XXXXXXXX as this API is no longer allowed by owner with this key
File: /home/drapko/doc/yapeal/class/api/ACorp.php(301)


Thank you!