enriquepiatti / Magicento

PHPStorm plugin for Magento developers
115 stars 35 forks source link

TimeOut trying to upload eval.php to the default Deployment Server #311

Open davidhiendl opened 4 years ago

davidhiendl commented 4 years ago

Hello,

I've just updated Magicento 1 to the newest version in order to be able to use it with 2020.1 release of PhpStorm. I was using a separate 2019.2.5 for legacy Magento 1 projects before. However when trying to execute a simple test script or using the "test php" function from Magicento I get the following error message: 16:37 Magicento Notification: TimeOut trying to upload eval.php to the default Deployment Server. You can set change the timeout limit from Magicento Settings

However the file is actually uploaded to the remote server according to PhpStorm file transfer logs and I verified it manually and tested the execution by navigating to var/magicento/eval.php in the browser manually. Regular uploads / syncs in PhpStorm are working correctly as always.

[15.04.20, 16:36] Upload file '/home/david/<<name-replaced>>/htdocs/var/magicento/eval.php' to '/www/htdocs/var/magicento/eval.php' [15.04.20, 16:36] Upload to <<name-replaced>> completed in 98 ms: 1 file transferred (1.2 kbit/s)

I've also added a "delay before executing script = 1s" for testing purposes with no effect.

Edit: Further investigation has revealed that the newer plugin also suffers the same problem in 2019.3.4 before Jetbrains reworked that entire Remote Connection Credentials system.

Originally I suspected it might be related to SSH Agent authentication (even though its unlikely, since the file is uploaded without a problem) but I now confirmed it's not by setting up a test host with password authentication.

Some details I forgot to add to the original report:

enriquepiatti commented 4 years ago

Hi @davidhiendl, you are not saying if it's Magicento1 or Magicento2. Please show me some screenshot of your Magicento settings, also try with a higher number for the delay, not 1, try with 10 or something like that. I guess you are using Magicento1, in that case you could try also disabling the upload evalp.php automatically. In this case it will execute always the last eval.php generated (that means the last php action executed with auto upload) if this works fine then a workaround could be to use an external sync software (or maybe in PhpStorm) to upload the new eval.php files generated by Magicento (every time you execute some Magicento command requiring actions in PHP). In this situation is important the delay before executing the script (so PhpStorm or your external sync software has enough time to upload ans sync that eval.php file)

davidhiendl commented 4 years ago

Hello, thanks for taking a look. It is Magicento 1. I've already tried various combinations of the upload delay setting with no effect. If I disable auto-upload in Magicento 1 it does execute whatever is stored on the server. However if enabled it actually uploads the file and it can be found manually on the server, it just does not execute it because it does not seem to recognize that the upload finished. The external sync to execute is not a real solution, this bug only appeared with the latest version of Magicento, it did work fine with an older version in PhpStorm 2019.x.

Here are the current settings: https://user-images.githubusercontent.com/11006964/80111256-f5d5ed00-857f-11ea-97e0-863bc988eb95.jpeg https://user-images.githubusercontent.com/11006964/80111260-f7071a00-857f-11ea-9590-0ec4cfc82783.jpeg

Edit: Debugging the code so far makes me thing that something goes wrong in the class PHP.executeWithHttp related to the call to IdeHelper.uploadFileToDefaultServer, which does not seem to trigger the following actions but works fine when auto-upload disabled (hence skipping the IdeHelper.uploadFileToDefaultServer call.

Edit2: I've just tested the eval-function in the most recent plugin in PhpStorm 2019.2.5 and it works here. It stops working in 2019.3 or newer.