Forum Replies Created
-
AuthorPosts
-
alexg
KeymasterHello Megan,
(I would have liked to reply to you sooner but I spent all day assisting people who faced memory issues with the latest update, causing the cron jobs to not run in some cases. Version
4.0.1
solves most of these issues but in certain server configurations with multiple external wallets there can be problems. Fortunately there is now a way to debug these issues. I noticed that you have enabled a few coins yourslef, so if you detect any such problems, let me know.)As for your issue with the exchange, the error is mine. I have made a mistake that I will correct in the next patch. I am a bit surprised that I never saw any error message, but somehow this went undetected.
Perhaps you could apply the fix to your code directly, and tell me if this is enough to solve the problem you encountered:
In file
includes/php-api.php
, line1357
, it now reads:SUM( amount - filled ) * rate AS a
This is obviously a mistake that can cause a MySQL error 1140, and can therefore cause the available balance calculation to be wrong.
The correct expression would be:
SUM( ( amount - filled ) * rate ) AS a
If you can, please edit your code and see if the problem is resolved.
As always I appreciate very much your help in spotting this.
with regards
January 31, 2019 at 4:51 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5721alexg
Keymaster@frodogrguez Thank you. What you see is not an error. It is the debug information I was looking for.
The debug info shows that exchange rates are downloaded. I do not see any execution of the cron jobs.
Did you click on the link at “Wallets” -> “Cron job” -> “Perioric tasks”?
After clicking on the link, are there any lines starting with “Bitcoin and Altcoin Wallets cron jobs STARTED”?
January 31, 2019 at 3:45 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5717alexg
KeymasterThank you both for providing me with the debug info.
@bigblue If your adapters are locked, then you should not expect any withdrawals to proceed from the pending state to anything else. Unlock the adapters first and the withdrawals will be processed. To do this:
1. Go to “Wallets” -> “Cron job” -> “Withdrawal locks” -> “Time to retain withdrawal secrets”. Set this either to 0 or to a large value, depending on how long you want to unlock the adapters for.
2. Go to your adapter settings and set the passphrase. If you have set the passphrase correctly, the adapters will then be unlocked.
I am also somewhat surprised to see that you are using almost half of the 512MB of memory. But if you have many plugins installed it is possible.
@frodogrguez Yor cronjob is indeed not running. It’s hard to know why. You have a lot of memory (512MB) allocated to WordPress. I normally test the code only with 40MB. The PHP timeout value is also sufficiently large. I keep mine at 30 seconds, but what you have also works. Also, make sure to enable the debug log in your wp-config.php. It is currently disabled.
@bigblue @frodogrguez You both say that you do not get any debug output. This is very strange. Can you confirm please? To be clear:
1. Make sure that you are running
4.0.1
, today’s release.2. Check “Verbose log output (debug)” and click save settings. (you should have already done this)
3. Trigger the cron job once via the link provided in the admin settings.
You can do this via your browser by simply following the link. The result should be a JSON response saying “result: success”
4. Then check the log file in
wp-content/debug.log
. There has to be something there. There should be a line that says “cron jobs STARTED”. Then a few more lines. Finally a line that says “cron jobs FINISHED”. Do you see any of this?January 31, 2019 at 1:48 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5714alexg
KeymasterThank you.
Is it possible for you to provide me with the information I requested in my previous post?
Namely:
1. The information found in the dashboard. For example:
Plugin version 4.0.1 Git SHA 3e011ed9 Web Server nginx/1.12.1 PHP version 7.0.18-0ubuntu0.16.10.1 WordPress version 5.1-beta3-44721 MySQL version 5.7.22-0ubuntu0.17.10.1-log DB prefix wp_ Is multisite false Is network activated false PHP max execution time 30 DB storage engine for 'wp_wallets_txs' InnoDB DB storage engine for 'wp_wallets_adds' InnoDB Constant 'WP_DEBUG' true Constant 'WP_DEBUG_LOG' true Constant 'WP_DEBUG_DISPLAY' false Constant 'DISABLE_WP_CRON' n/a Constant 'DSWALLETS_FILE' /var/www/wordpress/wp-content/plugins/wallets/wallets.php Constant 'WP_MEMORY_LIMIT' 40M PHP.ini 'memory_limit' 256M Cron jobs last ran on Thu, 31 Jan 19 13:44:18 +0000 Cron jobs last runtime (sec) 4 Cron jobs peak memory: 8022672 Cron jobs memory delta: 4936 PHP Extension 'curl' Loaded PHP Extension 'mbstring' Loaded PHP Extension 'zlib' Loaded Active wallets extensions wallets-exchange 0.6.0-beta, wallets-fiat 0.2.0-beta, wallets-multiadapter 1.0.5 Network-active wallets extensions n/a
2. any logs written out when you enable the setting “Wallets” -> “Cron job” -> “Verbose log output (debug)”.
For example, here’s what I get on my machine:
[31-Jan-2019 13:43:32 UTC] Bitcoin and Altcoin Wallets cron jobs STARTED. Elapsed: 0 sec, Mem delta: 0 bytes, Mem peak: 9159928 bytes, PHP / WP mem limits: 256 MB / 40 MB [31-Jan-2019 13:43:32 UTC] Bitcoin and Altcoin Wallets Fiat coin adapter for USD cron job finished. Elapsed: 0 sec, Mem delta: 17544 bytes, Mem peak: 9159928 bytes, PHP / WP mem limits: 256 MB / 40 MB [31-Jan-2019 13:43:32 UTC] Bitcoin and Altcoin Wallets Fiat coin adapter for EUR cron job finished. Elapsed: 0 sec, Mem delta: 17544 bytes, Mem peak: 9159928 bytes, PHP / WP mem limits: 256 MB / 40 MB [31-Jan-2019 13:43:36 UTC] Bitcoin and Altcoin Wallets Bitcoin core node cron job finished. Elapsed: 4 sec, Mem delta: 4192 bytes, Mem peak: 9159928 bytes, PHP / WP mem limits: 256 MB / 40 MB [31-Jan-2019 13:43:36 UTC] Bitcoin and Altcoin Wallets cron jobs FINISHED. Elapsed: 4 sec, Mem delta: 3752 bytes, Mem peak: 9159928 bytes, PHP / WP mem limits: 256 MB / 40 MB
If you can give me the same information from your server, it will help me a lot. Thank you.
Also, did you check that the adapters are unlocked? Go to the adapters list and check please. If the adapters are unlocked, they will have an open padlock sign such as: ? If they are locked, you will see this: ?
alexg
KeymasterHello Megan,
Thank you for reporting this. And I appreciate the detailed screenshots.
I will investigate immediately, as I believe that this is one of the last significant errors with the exchange.
Hopefully I will have a better reply soon.
In the meantime, could you please confirm that you are using
4.0.x
of wallets and0.6.0-beta
of the Exchange?thanks
January 31, 2019 at 12:22 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5707alexg
KeymasterOK, version
4.0.1
is out with a few performance and memory improvements.First of all, please check if it solves all the issues and let me know.
If the problem with withdrawals remains:
1. please go to “Wallets” -> “Cron job” -> “Verbose log output (debug)” and capture the log output during a log run if possible.
2. please send me the information found in the admin dashboard under “Bitcoin and Altcoin Wallets”.
Thank you both for your help in debugging this! I appreciate it.
with regards
alexg
KeymasterCould you please try again with version
4.0.1
, and let me know if the problem with withdrawals remains?Also, check that the adapters are unlocked in the adapters list view.
thank you
January 31, 2019 at 9:12 am in reply to: Version of plugin 4.0 gives error and wp stops working. #5695alexg
KeymasterHello,
Thank you. I believe I have a better understanding of what’s going on and why not everyone has this problem.
It has to do with memory limits but don’t increase your memory yet. I will shortly release a patch that does two things:
1. Makes it easier to detect such errors.
2. Uses less memory and database space.
Hopefully this will resolve the issue. I will contact you again after the patch is out, later today. In the meantime, if you want, you can attempt to apply the patch I mentioned above.
thanks for all your help
January 30, 2019 at 11:04 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5692alexg
KeymasterI believe I may have located a possible source of this problem.
Due to recent changes, the plugin queries the APIs for CoinGecko and CoinMarketCap in a different, better way. This however is possibly causing a large amount of data to be downloaded in certain cases. This data is saved in the DB even in most cases when it does not need to be saved.
If possible, can you try editing the file
includes/rates.php
, and change line712
from:if ( is_string( $result ) ) {
to
if ( is_string( $result ) && $cache_seconds ) {
If I am correct then this should make a huge difference in memory usage. If someone can give it a try I would like to know if it solved the problem.
If not, we will have to see in the next release, which will show debug info on memory statistics.
January 30, 2019 at 10:36 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5691alexg
KeymasterThanks, if you can do that, it would be very helpful, as this matches with what frodogrguez reported.
If you or your host can enable the MySQL Slow Query Log then that would show any slow queries.
Alternatively there could be clues in MySQL logs, PHP logs or even WordPress logs.
January 30, 2019 at 10:23 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5689alexg
KeymasterIt is possible that the new exchange rates code (for coinmarketcap and coingecko) is using more memory than it did before.
Unless someone shows me error messages, there is not much I can investigate further. But what I can do, is add some crash-detection code to the plugin. In the next patch the plugin will collect information in case of a crash, and will observe peak memory usage, and whether the cron tasks completed normally or not. So this might help with finding the root cause. I have already started working on this.
If you decide to downgrade, then yes, in this case, you would have to also downgrade to the previous version of the Exchange, since the latest one requires version 4.0.0.
with regards
January 30, 2019 at 7:43 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5687alexg
KeymasterI believe that by increasing the timeout limit on MySQL you are only masking the problem, not solving it. It’s simply the case that now PHP times out before MySQL.
Were you able to locate the stack trace for the original error?
January 30, 2019 at 7:14 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5685alexg
KeymasterIn addition to the above, I am currently reading on the error “Mysql Server has gone away”. It is usually solved if you increase the
max_allowed_packet
variable in MySQL. It is possible that simply editingmy.ini
and setting it to 16 or 24 Megs would solve the issue:[mysqld] max_allowed_packet=24M
It’s worth a try, based on the articles I just read. If you are unable to do the change yourself, you can ask your host to do this.
January 30, 2019 at 7:03 pm in reply to: Version of plugin 4.0 gives error and wp stops working. #5684alexg
KeymasterHello,
Thank you for reporting this, it sounds like an annoying issue.
1. Could you please look into the debug log where you found this error and see if the complete stack trace is available? A stack trace is a list of files, line numbers and functions that caused the error. It should be below the error you reported.
2. Also, is it possible for you to deactivate other plugins (mostly caching and security plugins) and see if the latest version 4.0.0 behaves then? It is likely that this is some interaction with a plugin you’re running, so this would help pinpoint it down.
Lastly, you can revert to the previous version,
3.9.4
until we find a fix. But please try to give me the two pieces of information I ask for, without it I wouldn’t know where to look, as I have not yet encounter this error myself.thank you
alexg
KeymasterYes, I will look into that. Thanks!
-
AuthorPosts