Support

Home Forums Event Espresso Premium Activating on staging server

Activating on staging server

Posted: August 15, 2023 at 10:40 am

Viewing 12 reply threads


wmnf

August 15, 2023 at 10:40 am

I am trying to test version 5.0.8 on our staging server. I see the message about the license not being for multiple domains preventing me from updating. I downloaded the latest version from the EE site and successfully updated it manually, but the site gives a critical error when activated…


[15-Aug-2023 16:29:18 UTC] PHP Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /www/source/wp-admin/includes/class-wp-filesystem-ftpext.php:438


Tony

  • Support Staff

August 15, 2023 at 10:53 am

Hi there,

Do you have the full stack trace for the above?


wmnf

August 15, 2023 at 12:09 pm

[15-Aug-2023 16:29:18 UTC] PHP Fatal error:  Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /www/source/wp-admin/includes/class-wp-filesystem-ftpext.php:438
Stack trace:
#0 /www/source/wp-admin/includes/class-wp-filesystem-ftpext.php(438): ftp_nlist()
#1 /www/source/wp-admin/includes/class-wp-filesystem-base.php(231): WP_Filesystem_FTPext->exists()
#2 /www/source/wp-admin/includes/class-wp-filesystem-base.php(79): WP_Filesystem_Base->find_folder()
#3 /www/source/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(787): WP_Filesystem_Base->wp_content_dir()
#4 /www/source/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(524): EEH_File::convert_local_filepath_to_remote_filepath()
#5 /www/source/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(898): EEH_File::exists()
#6 /www/source/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(859): EEH_File::validateFileForCopyOrMove()
#7 /www/source/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Sideloader.helper.php(246): EEH_File::move()
#8 /www/source/wp-content/plugins/event-espresso-core-reg/core/EE_Load_Textdomain.core.php(100): EEH_Sideloader->sideload()
#9 /www/source/wp-content/plugins/event-espresso-core-reg/core/EE_Load_Textdomain.core.php(41): EE_Load_Textdomain::loadTranslationsForLocale()
#10 /www/source/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(854): EE_Load_Textdomain::load_textdomain()
#11 /www/source/wp-includes/class-wp-hook.php(310): EE_System->load_core_configuration()
#12 /www/source/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#13 /www/source/wp-includes/plugin.php(517): WP_Hook->do_action()
#14 /www/source/wp-content/plugins/event-espresso-core-reg/core/EE_Bootstrap.core.php(47): do_action()
#15 /www/source/wp-includes/class-wp-hook.php(310): EE_Bootstrap::load_core_configuration()
#16 /www/source/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#17 /www/source/wp-includes/plugin.php(517): WP_Hook->do_action()
#18 /www/source/wp-settings.php(495): do_action()
#19 /www/source/wp-config.php(92): require_once('...')
#20 /www/source/wp-load.php(50): require_once('...')
#21 /www/source/wp-admin/admin.php(34): require_once('...')
#22 /www/source/wp-admin/index.php(10): require_once('...')
#23 {main}
  thrown in /www/source/wp-admin/includes/class-wp-filesystem-ftpext.php on line 438


wmnf

August 15, 2023 at 12:12 pm

The server is using WordPress 6.3 with PHP version 8.1.


Tony

  • Support Staff

August 15, 2023 at 12:29 pm

Hmmm ok.

So the code in question:


$wp_filesystem = EEH_File::_get_wp_filesystem($local_filepath);
return str_replace(WP_CONTENT_DIR . '/', $wp_filesystem->wp_content_dir(), $local_filepath);

Which is calling WP’s FileSystem, not something within Event Espresso (EE is calling the filesystem and then the filesystem is throwing a fatal).

Do you have anything within your sites wp-config.php file like:

define( 'FS_METHOD', {something} );


wmnf

August 15, 2023 at 12:52 pm

Thanks, yes. But I believe the same fatal message when I comment that line out of the wp-config.php file…

[15-Aug-2023 18:51:02 UTC] PHP Fatal error:  Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /opt/bitnami/wmnf/wp-admin/includes/class-wp-filesystem-ftpext.php:438
Stack trace:
#0 /opt/bitnami/wmnf/wp-admin/includes/class-wp-filesystem-ftpext.php(438): ftp_nlist()
#1 /opt/bitnami/wmnf/wp-admin/includes/class-wp-filesystem-base.php(231): WP_Filesystem_FTPext->exists()
#2 /opt/bitnami/wmnf/wp-admin/includes/class-wp-filesystem-base.php(79): WP_Filesystem_Base->find_folder()
#3 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(787): WP_Filesystem_Base->wp_content_dir()
#4 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(524): EEH_File::convert_local_filepath_to_remote_filepath()
#5 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(898): EEH_File::exists()
#6 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_File.helper.php(859): EEH_File::validateFileForCopyOrMove()
#7 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Sideloader.helper.php(246): EEH_File::move()
#8 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/EE_Load_Textdomain.core.php(100): EEH_Sideloader->sideload()
#9 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/EE_Load_Textdomain.core.php(41): EE_Load_Textdomain::loadTranslationsForLocale()
#10 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(854): EE_Load_Textdomain::load_textdomain()
#11 /opt/bitnami/wmnf/wp-includes/class-wp-hook.php(310): EE_System->load_core_configuration()
#12 /opt/bitnami/wmnf/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#13 /opt/bitnami/wmnf/wp-includes/plugin.php(517): WP_Hook->do_action()
#14 /opt/bitnami/wmnf/wp-content/plugins/event-espresso-core-reg/core/EE_Bootstrap.core.php(47): do_action()
#15 /opt/bitnami/wmnf/wp-includes/class-wp-hook.php(310): EE_Bootstrap::load_core_configuration()
#16 /opt/bitnami/wmnf/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#17 /opt/bitnami/wmnf/wp-includes/plugin.php(517): WP_Hook->do_action()
#18 /opt/bitnami/wmnf/wp-settings.php(495): do_action()
#19 /opt/bitnami/wmnf/wp-config.php(92): require_once('...')
#20 /opt/bitnami/wmnf/wp-load.php(50): require_once('...')
#21 /opt/bitnami/wmnf/wp-admin/admin.php(34): require_once('...')
#22 /opt/bitnami/wmnf/wp-admin/plugins.php(10): require_once('...')
#23 {main}
  thrown in /opt/bitnami/wmnf/wp-admin/includes/class-wp-filesystem-ftpext.php on line 438


Tony

  • Support Staff

August 15, 2023 at 1:04 pm

Hmm, ok, what about something setting WP_CONTENT_DIR within wp-config.php?

I’m guessing something is setting that to nothing?


Tony

  • Support Staff

August 15, 2023 at 1:06 pm

Or, you could try setting:

define( 'FS_METHOD', 'direct' );


wmnf

August 15, 2023 at 2:06 pm

Yes, direct is the setting for that constant. This staging server is on an AWS Lightsail WordPress instance. WP_CONTENT_DIR is not present in wp-config.php


Tony

  • Support Staff

August 15, 2023 at 6:14 pm

As far as I can tell, this is an issue with how the site is set up rather than Event Espresso itself.

EE uses the WordPress filesystem to access files based on how your install is configured, in this case it looks like it’s trying to use FTP to connect but that isn’t set up? I’m guessing it’s something within AWS but I don’t use it so can’t say for sure.

When you install/update plugins, does usually ask for FTP credentials?


wmnf

August 16, 2023 at 12:58 pm

Thanks. It does ask for FTP credentials unless I have the FS_METHOD constant defined as ‘direct’. With that constant defined, all other plugins install and update without issue. Only EE would crash the site when activated.

RESOLVED: I did some reading on the FS_METHOD constant and found that it needs to be near the top of the wp-config.php file just below db information. That seems to have worked.


Tony

  • Support Staff

August 17, 2023 at 6:14 am

Thanks. It does ask for FTP credentials unless I have the FS_METHOD constant defined as ‘direct’. With that constant defined, all other plugins install and update without issue. Only EE would crash the site when activated.

The issue isn’t the update itself.

Event Espresso downloads the translation files on the fly, why? Because we have a lot of translations so including them all bumps up the size of the plugin a lot.

So on activation of each version of the plugin EE will download the translation file and to do so it uses the WP_Filesystem. Most plugins don’t do that on the fly so you won’t see the same issue with them as the update itself is handled through WP core, the error above isn’t from the update process itself.

RESOLVED: I did some reading on the FS_METHOD constant and found that it needs to be near the top of the wp-config.php file just below db information. That seems to have worked.

That’s odd, it should work as long as it’s above this line:

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

Which is usually at the very bottom of wp-config.php and what calls all of the WP settings, you can’t set those same settings after that.


wmnf

August 17, 2023 at 11:12 am

Yes, I had it at the bottom of the file. Thanks!

Viewing 12 reply threads

The support post ‘Activating on staging server’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso