Skip to content

Weird sample data installation issue #1610

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

Closed
CoreyCole opened this issue Aug 3, 2015 · 26 comments
Closed

Weird sample data installation issue #1610

CoreyCole opened this issue Aug 3, 2015 · 26 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@CoreyCole
Copy link

I'm getting a weird issue trying to install sample data on a fresh webstore. I've wiped the database and pulled a fresh directory. I'm able to install without sample data, but when I run
composer require magento/sample-data:1.0.0-beta
bin/magento setup:upgrade
bin/magento sampledata:install admin

I get the following output:

~/html/magento2$ bin/magento sampledata:install admin
Installing theme:
.
Installing customers:
sh: 1: /usr/sbin/sendmail: not found
.
Installing CMS pages:
....
Installing catalog attributes:
...........................
Installing categories:
.........................................
Installing simple products:
PHP Fatal error:  Call to undefined method Magento\Catalog\Model\Resource\Product\Interceptor::getWriteConnection() in /var/www/html/magento2/app/code/Magento/SampleData/Module/Catalog/Setup/Product/Gallery.php on line 144
@ghost
Copy link

ghost commented Aug 3, 2015

Have you ever been able to do it? If so did you change anything?

Also, even though there's no need you might as well clean the var/generation and var/cache directories and try again.

@CoreyCole
Copy link
Author

Yes I've been able to before, but this time I'm trying to install the 1.0.0-beta sample data.

I just tried switching my version to "version": "0.74.0-beta16" and my sample data version to "magento/sample-data": "0.74.0-beta16" in my composer.json file. It works just fine that way.

@danslo
Copy link
Contributor

danslo commented Aug 3, 2015

@CoreyCole Is your magento2 install actually 1.0.0-beta too? I think you might be trying to install 1.0.0-beta sample data on an older magento version.

@CoreyCole
Copy link
Author

I did a fresh clone and in my composer.json the version line said 1.0.0-beta before I changed it.

@vpelipenko
Copy link
Contributor

sample-data:1.0.0-beta is compatible only with Magento 1.0.0-beta https://github.com/magento/magento2/tree/master. Version in develop branch is not stable and can produce some errors.

@vpelipenko vpelipenko added the PS label Aug 4, 2015
@CoreyCole
Copy link
Author

Thanks! Running git checkout master made the installation run smoothly.

@miguelbalparda
Copy link
Contributor

Same happened here with a fresh install of Magento 2 from this repo. I would say it is exatly the same scenario. @CoreyCole how did you fixed this? If I try to do a git checkout master i get
[magetwod@sip1-176 public_html]$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
composer.json
composer.lock
Please, commit your changes or stash them before you can switch branches.

@mbrinton01
Copy link

+1 for this error, used a clean install and it happens.

@miguelbalparda
Copy link
Contributor

I can confirm the solution proposed here works. After doing git checkout master and git pull I'm able to install Magento 2 with sample data.

@CoreyCole
Copy link
Author

Try git checkout -f -b master
On Aug 4, 2015 4:34 PM, "Miguel Balparda" [email protected] wrote:

I can confirm the solution proposed here works. After doing git checkout
master and git pull I'm able to install Magento 2 with sample data.


Reply to this email directly or view it on GitHub
#1610 (comment).

@mbrinton01
Copy link

Thank you @CoreyCole, I was just trying the same thing. Master branch works w/sample data.

@mazhalai
Copy link
Contributor

mazhalai commented Aug 4, 2015

We have created MAGETWO-41137 to investigate this issue

@mazhalai mazhalai added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 4, 2015
@santosh-brainvire
Copy link

Hello ,

I did git checkout master, still i am getting the issue.

/var/www/magento2/bin/magento sampledata:install admin
Installing theme:
.
Installing customers:
sh: 1: /usr/sbin/sendmail: not found
.
Installing CMS pages:
....
Installing catalog attributes:
...........................
Installing categories:
.........................................
Installing simple products:
PHP Fatal error: Call to undefined method Magento\Catalog\Model\Resource\Product\Interceptor::getWriteConnection() in /var/www/magento2/app/code/Magento/SampleData/Module/Catalog/Setup/Product/Gallery.php on line 144

@CoreyCole
Copy link
Author

@santosh-brainvire did you try git checkout -f -b master ?

@santosh-brainvire
Copy link

@CoreyCole Yes, i am now on branch master. Here is output of git status.

git status

On branch master

Changes not staged for commit:

(use "git add ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working directory)

modified: composer.json

modified: composer.lock

modified: pub/static/.htaccess

modified: var/.htaccess

Untracked files:

(use "git add ..." to include in what will be committed)

app/code/Magento/SampleData/

composer.json.bak

It took 14.03 seconds to enumerate untracked files. 'status -uno'

may speed it up, but you have to be careful not to forget to add

new files yourself (see 'git help status').

no changes added to commit (use "git add" and/or "git commit -a")

@CoreyCole
Copy link
Author

Maybe try making your composer.json file identical to the one here plus the one line to require the sample data 1.0.0-beta. Then try running sudo composer update

@MagePsycho
Copy link
Contributor

Even switching to master branch:
git checkout -f -b master

results in the same error:

Installing CMS pages:
....
Installing catalog attributes:
...........................
Installing categories:
.........................................
Installing simple products:
PHP Fatal error: Call to undefined method >Magento\Catalog\Model\Resource\Product\Interceptor::getWriteConnection() in /magento2beta/app/code/Magento/SampleData/Module/Catalog/Setup/Product/Gallery.php on line 144

Any workaround for fixing?

@MagePsycho
Copy link
Contributor

I didn't see the getWriteConnection() method in Magento\Catalog\Model\Resource\Product\Interceptor
[UPDATES]
But fresh installation with master branch fixed the issue :)

But. didn't get the [SUCCESS]: Magento Admin URI: /admin_1g5k83 line after successful installation. Wonder what will be my admin url (which was /admin).
So why there are two scenarios of generating custom admin url and the default /admin?

@mkz71
Copy link

mkz71 commented Aug 14, 2015

I have the same problem when I install the sample data on one of my server.
I find out that if I disable SELinux, the sample data was installed without any problem.

@ghost
Copy link

ghost commented Aug 14, 2015

Thanks. I'll add this to troubleshooting in the documentation.

@roman204
Copy link

hmm did the git checkout master but now a new error throws
PHP Fatal error: Declaration of Magento\Store\Model\StoreManagerInterface\Proxy::getGroups() must be compatible with Magento\Store\Model\StoreManagerInterface::getGroups($withDefault = false, $codeKey = false) in /var/generation/Magento/Store/Model/StoreManagerInterface/Proxy.php on line 8
[UPDATE] but after deleting the var/generation/* it works

@danslo
Copy link
Contributor

danslo commented Aug 16, 2015

Clear your var folder.
On Aug 16, 2015 10:13 AM, "Roman Hutterer" [email protected] wrote:

hmm did the git checkout master but now a new error throws
PHP Fatal error: Declaration of
Magento\Store\Model\StoreManagerInterface\Proxy::getGroups() must be
compatible with
Magento\Store\Model\StoreManagerInterface::getGroups($withDefault = false,
$codeKey = false) in
/var/generation/Magento/Store/Model/StoreManagerInterface/Proxy.php on line
8


Reply to this email directly or view it on GitHub
#1610 (comment).

@kokoc
Copy link
Member

kokoc commented Aug 17, 2015

The fix for this issue is delivered. Could you please verify it?

@miguelbalparda
Copy link
Contributor

@kokoc i faced the same issue today. Only 'git checkout master' worked.

@mrfroasty
Copy link

Replacing getWriteConnection() with getConnection() works as well ....

@mazhalai mazhalai mentioned this issue Sep 10, 2015
@piotrekkaminski
Copy link
Contributor

It should be fixed now.

magento-team pushed a commit that referenced this issue Oct 24, 2017
Fixed issue:
MAGETWO-72798 [Backport] - Website doesn't work with Redis cache installed and PhpRedis extension enabled - for 2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests