rocketeers / rocketeer

Send your projects up in the clouds
http://rocketeer.autopergamene.eu/
MIT License
2.66k stars 217 forks source link

Permission denied error on deployment #773

Open AllyRobins opened 6 years ago

AllyRobins commented 6 years ago

Hello!

I am currently getting the following errors upon trying to deploy a new project to staging branch.

In the deep end with Rocketeer and this is my first time deploying a new project with it. Existing projects deploy fine, it's just this new project that is giving hassle.

I can git clone the repo into the directory fine.

Was wondering if anyone can baby me through the issue, thanks.

|=> Server is not ready, running Setup task
|-- Setup (Set up the remote server for deployment) [~1.4s]
|---- Check (Check if the server is ready to receive the application) [~0.93s]
|------ Check/Php (Checks if the server is ready to receive a PHP application)
|=====> Checking presence of git
$ git --version
[rocketeer@[IP.00.000.000:PORT] ([server]) git version 2.7.4
|=====> Checking presence of Composer
|=====> Checking PHP version
|=====> Checking presence of required extensions
|=====> Checking presence of required drivers
|=====> Your server is ready to deploy
$ mkdir /var/www/folder/
[rocketeer@[IP.00.000.000:PORT] ([server]) mkdir:
[rocketeer@[IP.00.000.000:PORT] ([server]) cannot create directory ‘/var/www/folder/’
[rocketeer@[IP.00.000.000:PORT] ([server]) : File exists
[rocketeer@[IP.00.000.000:PORT] ([server]) 
$ mkdir -p /var/www/folder/releases
[rocketeer@[IP.00.000.000:PORT] ([server]) mkdir:
[rocketeer@[IP.00.000.000:PORT] ([server]) cannot create directory ‘/var/www/folder/releases’
[rocketeer@[IP.00.000.000:PORT] ([server]) : Permission denied
[rocketeer@[IP.00.000.000:PORT] ([server]) 
$ mkdir -p /var/www/folder/current
[rocketeer@[IP.00.000.000:PORT] ([server]) mkdir:
[rocketeer@[IP.00.000.000:PORT] ([server]) cannot create directory ‘/var/www/folder/current’
[rocketeer@[IP.00.000.000:PORT] ([server]) : Permission denied
[rocketeer@[IP.00.000.000:PORT] ([server]) 
$ mkdir -p /var/www/folder/shared
[rocketeer@[IP.00.000.000:PORT] ([server]) mkdir:
[rocketeer@[IP.00.000.000:PORT] ([server]) cannot create directory ‘/var/www/folder/shared’
[rocketeer@[IP.00.000.000:PORT] ([server]) : Permission denied
[rocketeer@[IP.00.000.000:PORT] ([server]) 
|===> Getting some informations about the server
|===> Successfully setup "folder" at "/var/www/folder"
|-- Primer (Run local checks to ensure deploy can proceed)
|-- CreateRelease (Creates a new release on the server) [~0.2s]
|---- Deploy/Clone (Clones a fresh instance of the repository by SCM)
|===> Cloning repository in "/var/www/folder/releases/20181105104212"
$ git clone "https://[user]:[password]@bitbucket.org/folder/folder2018.git" "/var/www/folder/releases/20181105104212" --branch="master" --depth="1"
[rocketeer@[IP.00.000.000:PORT] ([server]) fatal: could not create leading directories of '/var/www/folder/releases/20181105104212': Permission denied
|===> An error occured: "Unable to clone the repository", while running:
fatal: could not create leading directories of '/var/www/folder/releases/20181105104212': Permission denied
The tasks queue was canceled by task "Deploy"
seriquynh commented 5 years ago

It is caused by the server user that you try to deploy. That user account doesn't has permissions to write /var/www.

I think you can do in two ways:

  1. Give the user some permissions to write to /var/www (not recommended).
  2. Deploy to your server home directory ~/home/{username} and configure web server to access this directory.