pim-community-dev icon indicating copy to clipboard operation
pim-community-dev copied to clipboard

Project directory "/srv/pim" is not empty.

Open olimortimer opened this issue 4 years ago • 12 comments

I've installed Docker Desktop for Mac, which includes docker-compose. Clean install, no other docker containers. I then run the below command;

https://github.com/akeneo/pim-community-standard

docker run -u www-data -v $(pwd):/srv/pim -w /srv/pim --rm akeneo/pim-php-dev:4.0 \
    php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist \
    akeneo/pim-community-standard /srv/pim "4.0.*@stable"

But receive an error;

Creating a "akeneo/pim-community-standard" project at "./"
  
[InvalidArgumentException]
  Project directory "/srv/pim" is not empty.

Current versions;

docker-compose version 1.27.4, build 40524192

Docker version 19.03.13, build 4484c46d9d

olimortimer avatar Dec 03 '20 15:12 olimortimer

The folder where you're running this command must be empty. https://docs.akeneo.com/master/install_pim/docker/installation_docker.html

raduvoinea avatar Jan 15 '21 22:01 raduvoinea

The folder where you're running this command must be empty. https://docs.akeneo.com/master/install_pim/docker/installation_docker.html

Completely clean install and empty directory

olimortimer avatar Jan 15 '21 22:01 olimortimer

Same issue, in an empty folder, I running :

 docker run -ti -u www-data --rm \
    -v $(pwd):/srv/pim -v ~/.composer:/var/www/.composer -w /srv/pim \
    akeneo/pim-php-dev:4.0 php -d memory_limit=4G /usr/local/bin/composer create-project \
    akeneo/pim-community-standard /srv/pim "4.0.*@stable"

And I have the same error :

[InvalidArgumentException]                  
  Project directory "/srv/pim" is not empty.

PaulCastel avatar Jan 21 '21 17:01 PaulCastel

same problem

meltinbit avatar Jan 29 '21 21:01 meltinbit

If you delete the folder and let the command create it, it works. So, delete /srv/pim. It's not sufficient to delete just pim, you have to delete /srv/ as well, else you get this error message, be it installing manual or running from docker.

FromOopsToOps avatar Feb 01 '21 21:02 FromOopsToOps

I removed the parent directory and recreate it. Then, I running the same command and this time, that works ! Thanks :)

PaulCastel avatar Feb 03 '21 13:02 PaulCastel

@PaulCastel told ya. :)

FromOopsToOps avatar Feb 03 '21 13:02 FromOopsToOps

I have quite a few other projects in /srv folder and deleting that is not an option. I tried changing the directory to /pim/ankeneo (not created manually) and I still get this error

docker run -u www-data -v $(pwd):/pim/ankeneo -w /pim/ankeneo --rm akeneo/pim-php-dev:4.0     php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist  akeneo/pim-community-standard /pim/ankeneo "4.0.*@stable"
Creating a "akeneo/pim-community-standard" project at "./"

                                                  
  [InvalidArgumentException]                      
  Project directory "/pim/ankeneo" is not empty. 

aftabnaveed avatar Mar 02 '21 04:03 aftabnaveed

First, there's a typo on your command, it's akeneo not ankeneo.

Second, does this error also occurs if you delete the akeneo folder but not the pim folder? Create the pim folder, give it to www-data because that's the user you seem to be using to run and build docker, permission 755 to pim folder. Then execute the docker command.

FromOopsToOps avatar Mar 03 '21 15:03 FromOopsToOps

first of : delete srv and pim files they are located in the root file /srv/pim

By using the comand line : sudo rm -r srv

re run your command line in an empty directory it should work

moab374a avatar May 26 '21 08:05 moab374a

If you are on a Mac and have the open directory open, chances are it created an invisible .DS_Store file and that is why you are getting that message. Check the directory you are executing from with ls -la.

ifnull avatar Jul 29 '21 20:07 ifnull

Make sure that you're running the command in a completely empty directory. It can't contain any files or folders, like .git or .env Existing git repository was an issue in my case.

vkalchenko avatar Jul 19 '22 16:07 vkalchenko