This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 12 replies, has 3 voices.
Last updated by Subash Chandra Poudel 1 year, 6 months ago.
Assisted by: Subash Chandra Poudel.
Author | Posts |
---|---|
August 9, 2023 at 11:35 pm #14178771 | |
Vincent |
Hello, - I have a development environment, hosting a WP site, where I uploaded WPML manually (everything works fine locally). Simple steps to (probably) reproduce: rsync --archive --compress --del --rsh "ssh" /srv/mysite.test/wp-content/plugins/sitepress-multilingual-cms dev_user@mysite.dev:/var/www/mysite.dev/public/wp-content/plugins - I activate the plugin on mysite.dev, and this error pops up (plugin can't be activated): Warning: include(/var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/vendor/composer/../../classes/language/Detection/CookieLanguage.php): Failed to open stream: No such file or directory in /var/www/mysite.dev/wp-content/vendor/composer/ClassLoader.php on line 576 Warning: include(): Failed opening '/var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/vendor/composer/../../classes/language/Detection/CookieLanguage.php' for inclusion (include_path='.:/opt/plesk/php/8.0/share/pear') in /var/www/mysite.dev/wp-content/vendor/composer/ClassLoader.php on line 576 Fatal error: Uncaught Error: Class "WPML\Language\Detection\CookieLanguage" not found in /var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/inc/wpml_load_request_handler.php:18 Stack trace: #0 /var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/sitepress.php(296): wpml_load_request_handler() #1 /var/www/mysite.dev/wp-content/public/wp/wp-admin/includes/plugin.php(2314): include_once('...') #2 /var/www/mysite.dev/wp-content/public/wp/wp-admin/plugins.php(192): plugin_sandbox_scrape() #3 {main} thrown in /var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/inc/wpml_load_request_handler.php on line 18 --- Do we probably need an extra argument passed to the rsync command? There's something probably missing to preserve the integrity of the files... Probably that some file need to keep execution rights or something... That's out of my skills, but I would appreciate that you take a look because it completely break deployments workflows based on rsync. Before you ask, after rsyncing, I used scp to download back all the files locally, and git did not find any differrence, any modified or missing file. Any thought? Thank you by advanced 🙂 Regards. |
August 10, 2023 at 6:49 am #14179433 | |
Sumit Supporter
Languages: English (English ) Timezone: Asia/Kolkata (GMT+05:30) |
Hi, Thank you for contacting the support forum. I understand but the problem is not WPML it is rysnc command. It is possible that not all files are not copied. Can you please confirm if those mentioned files in the warning really exist on target server? 1. You can try -v parameters to check the output of command. I would recommend approaching the system admin for this. I am sorry, but we can't do much here unless you are sure it is WPML's fault. Thanks |
August 10, 2023 at 6:57 am #14179455 | |
Sumit Supporter
Languages: English (English ) Timezone: Asia/Kolkata (GMT+05:30) |
Also, please look at the path But in warning it says var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/ Please check the path you have defined in wp-config.php and correct the target directly. |
August 10, 2023 at 10:37 am #14181529 | |
Vincent |
Hello, Thank your for your answer, but, > I understand but the problem is not WPML it is rysnc command. I am not saying the issue comes more from WPML than rsync. I am just saying that both are conflicting with each others. As I said, there's probably a file that needs specific permissions, and that would be great if, as developers, we could know which ones, so we could still be able to deploy sites without a single plugin crashing the whole process. > It is possible that not all files are not copied. > 1. You can try -v parameters to check the output of command. > 2. Also use --delete-before to delete previous files before copy. > I am sorry, but we can't do much here unless you are sure it is WPML's fault. > Also, please look at the path Regards. |
August 11, 2023 at 8:55 am #14187023 | |
Subash Chandra Poudel |
Hi there, Thank you for the details. > > 1. You can try -v parameters to check the output of command. Please let us know how it goes once you try it. I have escalated this issue to our team, however in the meantime if you could also create a simple setup and provide us with the details of the site/server and steps to replicate the issue it will help us further troubleshoot the issue. I have enabled a private reply for you to share the credentials safely. Regards, |
August 11, 2023 at 9:51 am #14187657 | |
Vincent |
Hello, I figured out that Rsync is not the issue. Like @juslintek from the linked post, I am using a similar workflow, but completely differrent tools: Rsync is not the issue since I can actually locally unzip the WPML plugin, and then rsync it to the remote. My stack is using Shipit. This is the workaround I had to create (which is similar to juslintek's one). I just unzip your plugin locally and then rsync it to remote. If I don't do that, I get the mentionned errors in the initial topic. shipit.blTask('composer:install', async () => { await shipit.local('composer install --prefer-dist --no-scripts --no-dev --optimize-autoloader', {cwd: shipit.config.workspace}); }); shipit.on('fetched', function () { shipit.start('composer:install'); }); shipit.blTask('wpml', async () => { await shipit.local('rm -rf /tmp/shipit/sitepress-multilingual-cms && mkdir -p /tmp/shipit/sitepress-multilingual-cms && unzip -q /tmp/shipit/workspace/config/sitepress-multilingual-cms.zip -d /tmp/shipit') await shipit.remote('cd httpdocs/current && rm -rf public/app/plugins/sitepress-multilingual-cms && mkdir public/app/plugins/sitepress-multilingual-cms'); await shipit.copyToRemote('/tmp/shipit/sitepress-multilingual-cms', 'httpdocs/current/public/app/plugins', { rsync: ['--delete'] }); }); shipit.on('published', function () { shipit.start('wpml'); }) Note: I also tried the composer install command without the --optimize-autoloader argument: same issue. This workaround actually fix the issue, but it is bad practice and makes the deployment workflow harder and unusual. Best way to resolve would be, I guess, to figure out why a production composer install command affects the WPML plugin in such a manner. Best regards. |
August 13, 2023 at 9:48 am #14192803 | |
Subash Chandra Poudel |
Hi there, Thank you for your detailed reply with the details of the workaround and confirming the issue is resolved with the workaround. I will forward the details to our team in case this can help other people or our team. - In the meantime can you please pass the -c parameter to check for checksums and let me know how it goes? - Also, can you please let me know if this happens only on the first/initial rsync? Or does it also happens after the files are synced initially, WPML is fixed with manual install/update then further rsync of the files? Regards, |
August 13, 2023 at 5:59 pm #14193593 | |
Vincent |
Hello, > In the meantime can you please pass the -c parameter to check for checksums and let me know how it goes? > Also, can you please let me know if this happens only on the first/initial rsync? Or does it also happens after the files are synced initially, WPML is fixed with manual install/update then further rsync of the files? I'll check in the next few days about the mentioned tests and will let you know. Regards. |
August 15, 2023 at 11:17 am #14202621 | |
Subash Chandra Poudel |
Thank you for the updates, Our team is still looking into the issue further. In the meantime, can you please check and let us know if you or any of the plugins on the site use Monolog or PSR/login for your setup? It will help us verify if the issues could be related to other known issues and help us further troubleshoot the issue. Also, please let us know how it goes when you pass the -c parameter once you test it. |
September 1, 2023 at 9:09 am #14325363 | |
Subash Chandra Poudel |
Hi there, I would appreciate if you could let me know the answer to my question in the previous reply linked next, this will help our second tier team troubleshoot the issue further. https://wpml.org/forums/topic/wpml-cant-be-deployed-via-rsync/#post-14202621 Also, did you got a change to run the "-c parameter" and see how it goes? Regards, |
September 1, 2023 at 4:19 pm #14328065 | |
Vincent |
Hello there, I was answering your requests, and then decided to perform a few more tests.... Until I finally realized that the path requesting the CookieLanguage.php file is.... Wrong !! ^^ As you can see in my initial message, I posted this: Warning: include(/var/www/mysite.dev/wp-content/public/app/plugins/sitepress-multilingual-cms/vendor/composer/../../classes/language/Detection/CookieLanguage.php): Failed to open stream: No such file or directory in /var/www/mysite.dev/wp-content/vendor/composer/ClassLoader.php on line 576 I took a look onto my repository, and the file is not located in the "language" directory, but in the "Language" directory (notice the first capitalized letter !). Did you somehow change that folder name some time ago or something? If I unzip your folder, the language folder isn't capitalized, and exists as "language". Well... This appears to be a Git issue. I don't understand why and how it is possible, but Git did not take care about a "language" folder being probably renamed to "Language", and that made hell a mess. To fix and confirm the issue, I deleted WPML from my repository, and then unzipped the plugin again, committed and pushed again. I can now see the correct structure on my Gitlab. I'll still need to test and finally confirm the issue by removing my workaround, and attempt to deploy normally, and I'll let you know (but I think it will fix it). By the way, since Git seems to be involved in that big headache, this is the version, in case that can help: Git for Windows 2.41.0 I am normally using PHP Storm to commit, but I noticed a strange behavior on Gitkraken. I wasn't able to unstash the files located in the Language directory... They were buggy. I never saw that behavior before so I check the repository and noticed this issue. Git was stuck on updating files within a language directory while he was expecting to do that into the language directory. I'll let you know about the final result. Best regards. |
September 1, 2023 at 5:44 pm #14328355 | |
Vincent |
Just decided to search the web about "this git issue"... It is not one, but it looks like it is just the default Git behavior. What a nightmare... Looks like git config core.ignorecase false is a must use... I wasn't expecting this... Sorry I reported such a "WPML issue" while the solution actually stands in a single Git config line... Regards. |
September 4, 2023 at 3:46 pm #14338385 | |
Subash Chandra Poudel |
Thank you for confirming that the original issue is resolved and sharing the fix with us. This will help other people with similar cases in the future. Feel free to mark this ticket as resolved if you no longer need help with this issue and also feel free to contact us again in future for any help or queries regarding WPML. |
September 7, 2023 at 9:03 am #14357461 | |
Vincent |
Thank you for your patience and the interest you put into that issue. I hope this ticket will help anyone struggling with that kind of git configuration strangely leading to missing files after updating. Best regards. |