paliarush / magento2-vagrant-for-developers

Vagrant Box for Magento 2 Developers
MIT License
446 stars 165 forks source link

Sample data for CE #74

Closed Szaamaan closed 8 years ago

Szaamaan commented 8 years ago

Hi,

is it me, or is sample data not working currently? The default config.yaml file seems to have filled out defaults for the CE edition with sample data (only thing NOT set is the "install_sample_data" option).

Regardless of the "install_sample_data" option, the sample data isn't installed. If I attempt to deploy it manually using "bash m-bin-magento sample:deploy" (which seems it shouldn't be needed, but regardless) it fails with the following:

$ bash m-bin-magento sample:deploy
+ arguments=sample:deploy
+ cd /d/magento/vagrant-magento
+ vagrant ssh -c '$MAGENTO_ROOT/bin/magento sample:deploy'
<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 8
    - The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 9
    - The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 10
    - The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 11
    - The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 12
    - The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 13
    - The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 14
    - The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 15
    - The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 16
    - The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 17
    - The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 18
    - The requested package magento/sample-data-media could not be found in any version, there may be a typo in the package name.
  Problem 19
    - The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 20
    - The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.
There is an error during sample data deployment. Composer file will be reverted.

I'm assuuming this is caused by some disparity between the used Magento2 and sample data GIT, but I'm unsure how to resolve it.

paliarush commented 8 years ago

@Szaamaan can you please post here your config.yaml content (repository_url and magento sections)?

Szaamaan commented 8 years ago

@paliarush Like I wrote, I'm using the stock config basically:

repository_url:
  # [To apply changes: init-project -fc]
  # git@github.com:magento/magento2ce.git OR custom one
  ce: "git@github.com:magento/magento2.git"
  # git@github.com:magento/magento2ee.git OR custom one
  ee: ""
  # can be replaced with custom repository
  ce_sample_data: "git@github.com:magento/magento2-sample-data.git"
  # git@github.com:magento/magento2-sample-data-ee.git OR custom one
ee_sample_data: ""

The only changes I've made to the config are:

paliarush commented 8 years ago

Config looks good.

Have you tried to run bash ./init_project.sh -fc? Note that this command will remove your current code base and box itself, then will recreate everything from scratch.

There are 2 ways to install sample data: via composer or via linking git repositories. Here we use second approach. So don't try m-bin-magento sampledata:deploy. BTW, there was a typo in your command bash m-bin-magento sample:deploy, should be sampledata:deploy.

Szaamaan commented 8 years ago

@paliarush Yes. I've tried that. Again, it seems the sample data is somehow incompatible with the dev version of Magento...

paliarush commented 8 years ago

Just set up new instance of vagrant project from scratch using the following settings and sample data was successfully installed:

repository_url:
  ce: "git@github.com:magento/magento2.git"
  ee: ""
  ce_sample_data: "git@github.com:magento/magento2-sample-data.git"
  ee_sample_data: ""
magento:
  # [To apply changes: m-switch-to-ce -f OR m-switch-to-ee -f]
  install_sample_data: 1

BTW specified sample data repository is kept in sync with develop branch of Magento, so this should not be a problem.

My host is OSX, which one do you have? Unfortunately I don't have access to Windows host at the moment to test it.

Will leave it open, maybe someone also has the same problem. Thanks for reporting this.

Szaamaan commented 8 years ago

In that case it might be something with the script running on a Windows host. Again, sample data is never installed, despite the correct settings in config.yaml.

EDIT: Excuse my ignorance, but perhaps I'm missing some step?

From my understanding - running the config you posted should result in a working Magento installation already populated with sample data (visible right on the main page)? If not, then is there another thing required?

If no other commands or changes are needed then I have a feeling it might be the symlinks on Windows not working the same way they might be under other OSes.

paliarush commented 8 years ago

@Szaamaan just looked at init_project.sh and found old comment related to linking EE (the same is valid for sample data linking):

Automatic switch to EE during project initialization cannot be supported on Windows

So on Windows you will not get EE and Sample data installed just by running init_project.sh. You need to perform one more step after CE with no sample data is successfully installed. Run m-switch-to-ce -f, then you should see prompt:

Wait while Magento2 code is uploaded in PhpStorm and press any key to continue...

Basically you need to make sure that after symlinks were created on your host, all Sample data files are uploaded to the guest. Current recommended way to do this is using PhpStorm deployment feature (should be configured for you by init_project.sh), however you can use any other sync method (e.g. rsync).

After you hit any button to continue installation, Magento with sample data should be installed.

jasonheecs commented 8 years ago

Hi,

I'm having the same issue on OSX 10.11.6.

One thing I noticed is when doing a ls of $MAGENTO_ROOT/dev/tools is that the symlink seems to be an invalid one. Could it be due to the case sensitivity of the file paths (users vs Users)?

screen shot 2016-08-15 at 1 49 31 am
paliarush commented 8 years ago

@jasonheecs since OSX is case insensitive and Ubuntu is case sensitive, it can be a problem. Please read item 9 in https://github.com/paliarush/magento2-vagrant-for-developers#faq

I recommend to do init_project.sh -fc in this case (will pull codebase again and re-create box based on your current config.yaml).

TapaniAla commented 7 years ago

For some reason Windows Git Bash doesn't always show the message "Wait while ...". It just stops without any message on screen. I have all debugging options set. Anyhow log file m-switch-to-ce.log shows the message when execution stops. Proposed solution works so just copy/deploy manually sample data from host to guest and continue installation.