Getting Error on composer run to install modules "VirtualAlloc" - drupal

Getting this error on "composer require drupal/module-name".
I want to install a module on my drupal site but it always returns me this error.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualFree() failed: [0x000001e7] Attempt to access invalid address.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualFree() failed: [0x000001e7] Attempt to access invalid address.
Fatal error: Out of memory (allocated 1711276032) (tried to allocate 4096 bytes) in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on
line 223

Update on your php.ini file's: memory_limit= XXXM
Replace XXXM value by the memory that you wanna allocate.
Or replace XXXM by -1 to negate memory limit condition.

Virtual memory Error on composer run Solution (Windows)
Download PHP 7.3+ and place on a folder on c drive
Change the environment variable path of PHP to new php
Set the memory limit to -1 in PHP 7.3+ ini file Also uncomment the required extensions.
Run Composer

Related

Installing annotations in composer

I used composer to install pimcore. Right now I am attempting to add routing for a new theme I'm using, but I reach a routing error. Based on symfony's documentation I realized I need to run composer require annotations but I get hit with this error:
[InvalidArgumentException]
Could not find package annotations.
Did you mean one of these?
minime/annotations
zeptech/annotations
ray/di
jms/metadata
jms/aop-bundle
after some looking around, I see that I first need to run composer require sensio/framework-extra-bundle. However, when I run it, after some time, I get hit with
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
PHP Fatal error: Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
Fatal error: Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
I'm realizing this is a memory issue, there are currently 3GB of memory on the server (running via DigitalOcean). What are my options? Running Ubuntu 16.04 btw.
I should add that my memory limit in php.ini is set to -1.
That is because PHP is running with a memory limit by default. You can by-pass it by running the following command.
php -d memory_limit=-1 /usr/local/bin/composer install
Another option would be updating your php.ini files and setting the memory_limit = -1.
Update: I solved it by running
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
to add 4 GB of memory from the hard drive.
Then I just run my command and it updated the framework with no problem. Hope this helps someone

Grakn mem issue windows local installation

I don't have a tech background. I installed grakn locally on windows into a folder, I am able to start the server and use the workbase, however when I tried to do the compute query in the documentation tutorial (social_network), it throws an error:
2020-08-18 16:59:33,614 [transaction-listener] ERROR g.c.s.r.SessionService$TransactionListener - Runtime Exception in RPC TransactionListener: java.lang.IllegalArgumentException: System memory 259522560 must be at least 471859200. Please increase heap size using the --driver-memory option or spark.driver.memory in Spark configuration.
I then set env variables:
"SERVER_JAVAOPTS": -Xmx4G
"STORAGE_JAVAOPTS": -Xmx4G
Outcome nok:
Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
I then set env variables:
"SERVER_JAVAOPTS": -Xmx2G
"STORAGE_JAVAOPTS": -Xmx2G
Outcome again nok:
Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': ''
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': ''
I then set env variables to this:
"SERVER_JAVAOPTS": -Xmx1G
"STORAGE_JAVAOPTS": -Xmx1G
Outcome now is ok:
Starting Storage......SUCCESS
Starting Grakn Core Server.....SUCCESS
...but why can't I assign more mem? I have totally 32GB and usage is around 20%.
Many thanks in advance.
There are two possible reasons for this:
JVM is unable to allocate 4G of RAM because it's occupied by something else. However, as you've said only 20% or RAM is used, this is an unlikely reason.
32-bit JVM are unable to address more than 4GB of RAM 1, so you should check if it applies to you and reinstall your JVM to be 64-bit if it does.

How to fix chmod errors when updating wordpress theme?

I recently upgraded from php 5 to 7.2 and my wp site didnt work, service temporarily unavailable error. So I logged into the backend and WP 5.4 was telling me I needed to check security issues of which I resolved 2 of 3 automatically but 1 could not which is "restrict access to files and folders". So I tried to update the 2017 theme and when I do so I get a bunch of these(although its the same error):
Selected items were updated with errors:
- Unable to update theme 'twentyseventeen_1.7_1_', details: PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168...
and near the end it reads:
Warning: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions. "front-page.php, rtl.css, 404.php...
Then in the end it doesnt update of course. A suggestion by the Wordpress Toolkit on plesk is:
Im using filezilla and changing the permissions to those files but I get "operation not permitted".
[SOLVED] (at least for me)
Me too on Cloudways and Digital Ocean.
Just restart the server and error is gone.

Symfony 4 - php bin/console server:run not works

I have a problem with this command : php bin/console server:run on Symfony 4
When I go to http://127.0.0.1:8000/ I have this error message :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'J:\my_project\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Indeed, the router.php file does not exist !
But if I run this command : php -S 127.0.0.1:8000 -t public everything is ok.
Any idea ?
First check that you have installed the SF4 Web Server bundle :
> composer require server --dev
then you can start using it through Symfony using run / start command
Not sure if this is the case for you too, but it is probably worth checking (and may also be interesting for others having the same problem).
My antivirus software likes to put the router.php in quarantine (effectively removing it from that directory). Check if yours did the same and if so restore it and create an exception for that file. Additionally you should configure your antivirus to notify you if it puts something in quarantine, so you can intervene in time.

Cpanel sql backup failed

My hosting provider makes daily automated full site backups, like the ones which you can make using Cpanel. After requesting one of these files I noticed that the mysql folder contains files with all of my database names, but all of them have a size of 0 KB.
I've been provided with some logs from the export script:
ERROR: Failed to dump one or more databases
warn [pkgacct] db_1: mysqldump: unknown variable 'innodb_file_per_table=1'
warn [pkgacct] db_1: mysqldump failed -- database may be corrupt
(0 bytes) warn [pkgacct] Failed to dump database db_1
db_wp2warn [pkgacct] db_wp2: mysqldump: unknown variable 'innodb_file_per_table=1'
warn [pkgacct] db_wp2: mysqldump: unknown variable 'innodb_file_per_table=1'
db_wp2.dev_commentmeta
note : The storage engine for the table doesn't support repair
I'm not even using any innodb tables (all of them are MyISAM) and I don't understand what mysqldump: unknown variable 'innodb_file_per_table=1' refers to. Any ideas how to fix this without compromising data?
innodb_file_per_table=1
This line is most likely in your /etc/my.cnf file. Remove that line or comment it out and restart mysql, this should resolve it.

Resources