Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error when installing sample data #879

Closed
AreDubya opened this issue Dec 10, 2016 · 6 comments
Closed

PHP Fatal error when installing sample data #879

AreDubya opened this issue Dec 10, 2016 · 6 comments
Labels

Comments

@AreDubya
Copy link

AreDubya commented Dec 10, 2016

Hello,

I have tried a few times to install the sample data, but I get the same error each time :

Choose a magento version: 13
Enter installation folder: [./magento]./

  • Installing magento-mirror-1.9.3.1 (1.9.3.1)
    Loading from cache

Please enter the database host [localhost]:
Please enter the database username [root]: dev1
Please enter the database password []: dev1
Please enter the database name [magento]: dev1
Please enter the database port [3306]:
Please enter the table prefix []:
Install sample data? [y]: y

  • Installing sample-data-1.9.2.4 (1.9.2.4)
    Loading from cache
    PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 18446744073709543424 bytes) in phar:///usr/local/bin/n98-magerun.phar/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php on line 28

That's a pretty huge attempted allocation. I have 1024M as the memory_limit, but that won't cut it with the 18,446 Petabyte allocation ; )

Any idea what would cause this?

@ktomk
Copy link
Collaborator

ktomk commented Dec 10, 2016

Let me give this a try, I have to see it myself first.

@ktomk
Copy link
Collaborator

ktomk commented Dec 11, 2016

Can reproduce at exactly the same place. I've bee running the following command:

bin/n98-magerun install --magentoVersionByName=magento-mirror-1.9.3.1 \
  --installationFolder=magento/reproduce --dbHost=localhost --dbUser=root --dbPass="" \
  --dbName="magento_magerun_reproduce" --installSampleData=1

Error message is the same:

PHP Fatal error: Allowed memory size of -1 bytes exhausted (tried to allocate 18446744073709543424 bytes) in /home/ktomk/PhpstormProjects/build-mageruns/n98-magerun/vendor/composer/composer/src/Composer/Downloader/TarDownloader.php on line 28

That line is the creation of a PharData:

$archive = new \PharData($file);

The $file tar.gz file in question that is causing this is:

I could isolate the error to that single ctor call:

php -r '$p = new PharData($argv[1]);' -- magento/reproduce/_temp_demo_data/72bcbbbcd05e71c17fda65a84e262ad5.gz 

It takes a short moment until it crashes.

@ktomk
Copy link
Collaborator

ktomk commented Dec 11, 2016

Making use of the zip-file instead of the tar.gz file does not help either, with the zipfile at the same place the following error is:

[UnexpectedValueException]
phar error: end of central directory not found in zip-based phar "/home/ktomk/PhpstormProjects/build-mageruns/n98-magerun/magento/reproduce/_temp_demo_data/6c2
69b1264fe1e32b8248abfa052aa09.zip"

That signals an error in the zip-file, which is easily confirmed:

$ unzip -t magento-sample-data-1.9.2.4.zip 
Archive:  magento-sample-data-1.9.2.4.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of magento-sample-data-1.9.2.4.zip or
        magento-sample-data-1.9.2.4.zip.zip, and cannot find magento-sample-data-1.9.2.4.zip.ZIP, period.

That test reminds me to verify the tar.gz file as well:

$ tar -tzf magento-sample-data-1.9.2.4.tar.gz >/dev/null

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Looks like the files provided from magento.com are invalid:

5ad29dc3df38d21b2407c49f66d5308b01961d60  magento-sample-data-1.9.2.4-2016-10-11-07-38-13.tar.gz

Wouldn't be the first time. However I also suspect an issue upstream in PharData perhaps worth to report (/e 73719).

@ktomk
Copy link
Collaborator

ktomk commented Dec 11, 2016

We believe that the bug reported is fixed in the stable version. It can be upgraded to it using the self-update command. The first stable version with this fix is 1.97.27.

@ktomk ktomk closed this as completed Dec 11, 2016
@ktomk ktomk added the bug label Dec 11, 2016
@tkn98
Copy link
Collaborator

tkn98 commented Dec 12, 2016

@AreDubya: Thank you for your report!

@AreDubya
Copy link
Author

@ktomk : Sorry for the delayed response, thanks for the detailed debug!

@tkn98 : Thank you for the amazing tool! I'm glad the report was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants