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

fatal: could not create work tree dir Permission denied #1422

Closed
DonRichards opened this issue Oct 16, 2020 · 13 comments
Closed

fatal: could not create work tree dir Permission denied #1422

DonRichards opened this issue Oct 16, 2020 · 13 comments

Comments

@DonRichards
Copy link


BUG REPORT INFORMATION

Description

Trying to run this for the first time and I'm getting an error.

Steps to reproduce the issue:

  1. run $ fin project create
  2. Name your project: testing
  3. What would you like to install?: 1
    1. Tried this with options 1, 2, and 3 with the same error
  4. Do you wish to proceed? [y/n]: y

Describe the results you received:

fatal: could not create work tree dir 'testing': Permission denied
Checkout finished with errors. Do you wish to continue? [y/n]: n

Describe the results you expected:

No errors.

Output of fin config:

fin config output
---------------------
COMPOSE_PROJECT_NAME_SAFE: dockersal
COMPOSE_FILE:
/Users/admin/.docksal/stacks/volumes-nfs.yml
/Users/admin/.docksal/stacks/stack-default.yml
/Users/admin/Github/dockersal/.docksal/docksal.yml
ENV_FILE:
/Users/admin/Github/dockersal/.docksal/docksal.env

PROJECT_ROOT: /Users/admin/Github/dockersal
DOCROOT: docroot
VIRTUAL_HOST: dockersal.docksal
VIRTUAL_HOST_ALIASES: *.dockersal.docksal
IP: 192.168.64.100
MYSQL: 192.168.64.100:32793

Docker Compose configuration
---------------------
services:
  cli:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      COMPOSER_ALLOW_XDEBUG: '0'
      COMPOSER_DISABLE_XDEBUG_WARN: '0'
      DOCROOT: docroot
      DRUSH_ALLOW_XDEBUG: '0'
      DRUSH_OPTIONS_URI: dockersal.docksal
      GIT_USER_EMAIL: donrichards@utk.edu
      GIT_USER_NAME: DonRichards
      HOST_GID: '20'
      HOST_UID: '501'
      MYSQL_DATABASE: default
      MYSQL_HOST: db
      MYSQL_PASSWORD: user
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
      PHP_IDE_CONFIG: null
      SECRET_ACAPI_EMAIL: null
      SECRET_ACAPI_KEY: null
      SECRET_ACQUIACLI_KEY: null
      SECRET_ACQUIACLI_SECRET: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      SSH_AUTH_SOCK: /.ssh-agent/proxy-socket
      VIRTUAL_HOST: dockersal.docksal
      XDEBUG_CONFIG: remote_connect_back=0 remote_host=192.168.64.1
      XDEBUG_ENABLED: '0'
    hostname: cli
    image: docksal/cli:2.11-php7.3
    labels:
      io.docksal.shell: bash
      io.docksal.user: docker
    logging:
      options:
        max-file: '10'
        max-size: 1m
    volumes:
    - docksal_ssh_agent:/.ssh-agent:ro
    - /Users/admin/.docksal/tmp/dockersal:/Users/admin/.docksal/tmp/dockersal:ro
    - cli_home:/home/docker:rw
    - project_root:/var/www:rw,nocopy,cached
  db:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: default
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: user
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    hostname: db
    image: docksal/mysql:5.6-1.5
    logging:
      options:
        max-file: '10'
        max-size: 1m
    ports:
    - 3306/tcp
    volumes:
    - db_data:/var/lib/mysql:rw
    - project_root:/var/www:ro,nocopy,cached
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      APACHE_BASIC_AUTH_PASS: null
      APACHE_BASIC_AUTH_USER: null
      APACHE_DOCUMENTROOT: /var/www/docroot
      APACHE_FCGI_HOST_PORT: cli:9000
    hostname: web
    image: docksal/apache:2.4-2.3
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /Users/admin/Github/dockersal
      io.docksal.virtual-host: dockersal.docksal,*.dockersal.docksal,dockersal.docksal.*
    logging:
      options:
        max-file: '10'
        max-size: 1m
    volumes:
    - project_root:/var/www:ro,nocopy,cached
version: '2.1'
volumes:
  cli_home: {}
  db_data: {}
  docksal_ssh_agent:
    external: true
    name: docksal_ssh_agent
  project_root:
    driver: local
    driver_opts:
      device: :/Users/admin/Github/dockersal
      o: addr=192.168.64.1,vers=3,nolock,noacl,nocto,noatime,nodiratime,actimeo=1
      type: nfs

---------------------

Output of fin sysinfo:

fin sysinfo output
fin sysinfo
███  OS
Darwin Mac OS X 10.15.7
Darwin dricha28imacpro.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

███  ENVIRONMENT
MODE : Docker Desktop

███  FIN
fin version: 1.99.0

███  DOCKER COMPOSE
EXPECTED VERSION: 1.26.0
docker-compose version 1.26.0, build d4451659
docker-py version: 4.2.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020

███  DOCKER
EXPECTED CLIENT VERSION: 19.03.9
EXPECTED SERVER VERSION: 19.03.8

Client: Docker Engine - Community
Version:           19.03.9
API version:       1.40
Go version:        go1.13.10
Git commit:        9d988398e7
Built:             Fri May 15 00:23:14 2020
OS/Arch:           darwin/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
Version:          19.03.12
API version:      1.40 (minimum version 1.12)
Go version:       go1.13.10
Git commit:       48a66213fe
Built:            Mon Jun 22 15:49:35 2020
OS/Arch:          linux/amd64
Experimental:     false
containerd:
Version:          v1.2.13
GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version:          1.0.0-rc10
GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version:          0.18.0
GitCommit:        fec3683

███  DOCKSAL: PROJECTS
project             STATUS                        virtual host                                                project root
dockersal           Up About a minute (healthy)   dockersal.docksal,*.dockersal.docksal,dockersal.docksal.*   /Users/admin/Github/dockersal

███  DOCKSAL: VIRTUAL HOSTS
*.dockersal.docksal
dockersal.docksal.*
dockersal.docksal

███  DOCKSAL: NETWORKING

DOCKSAL_IP: 192.168.64.100
DOCKSAL_VHOST_PROXY_IP: 0.0.0.0
DOCKSAL_DNS_IP: 0.0.0.0
DOCKSAL_DNS_DISABLED: 0
DOCKSAL_NO_DNS_RESOLVER: 0
DOCKSAL_DNS_UPSTREAM:
DOCKSAL_DNS_DOMAIN: docksal

Checking connectivity to http://dns-test.docksal...
Host: FAIL
Containers: FAIL

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID        IMAGE                      COMMAND                  CREATED              STATUS                        PORTS                                      NAMES
ac53a2a63df7        docksal/apache:2.4-2.3     "httpd-foreground"       About a minute ago   Up About a minute (healthy)   80/tcp, 443/tcp                            dockersal_web_1
d28844d720ea        docksal/mysql:5.6-1.5      "docker-entrypoint.s…"   2 minutes ago        Up About a minute (healthy)   0.0.0.0:32793->3306/tcp                    dockersal_db_1
80b6cf405890        docksal/cli:2.11-php7.3    "/opt/startup.sh sup…"   2 minutes ago        Up About a minute (healthy)   22/tcp, 3000/tcp, 9000/tcp                 dockersal_cli_1
fee1438e75ff        docksal/ssh-agent:1.3      "docker-entrypoint.s…"   29 minutes ago       Up 29 minutes (healthy)                                                  docksal-ssh-agent
ff7ef02aa728        docksal/dns:1.1            "docker-entrypoint.s…"   29 minutes ago       Up 29 minutes (healthy)       0.0.0.0:53->53/udp                         docksal-dns
8208d8ff24c4        docksal/vhost-proxy:1.6    "docker-entrypoint.s…"   29 minutes ago       Up 29 minutes (healthy)       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   docksal-vhost-proxy
4bf4d2436957        wodby/nginx:1.19-5.10.5    "/docker-entrypoint.…"   2 hours ago          Up 2 hours                    80/tcp                                     my_drupal9_project_nginx
5adfd1e6c86a        wodby/mariadb:10.5-3.9.1   "/docker-entrypoint.…"   2 hours ago          Up 2 hours                    3306/tcp                                   my_drupal9_project_mariadb
93711f8532dc        portainer/portainer        "/portainer --no-aut…"   2 hours ago          Up 2 hours                    9000/tcp                                   my_drupal9_project_portainer
66e98da73004        wodby/drupal:9-4.21.4      "/docker-entrypoint.…"   2 hours ago          Up 2 hours                    9000/tcp                                   my_drupal9_project_php
b209116ce062        traefik:v2.0               "/entrypoint.sh --ap…"   2 hours ago          Up 2 hours                    0.0.0.0:8000->80/tcp                       my_drupal9_project_traefik
fae3557adc74        wodby/drupal:9-4.21.4      "/docker-entrypoint.…"   2 hours ago          Up 2 hours                    9000/tcp                                   my_drupal9_project_crond
5d56c793d2d7        mailhog/mailhog            "MailHog"                2 hours ago          Up 2 hours                    1025/tcp, 8025/tcp                         my_drupal9_project_mailhog

███  DOCKER: NETWORKS
NETWORK ID          NAME                    DRIVER              SCOPE
614faf0f7acf        _default                bridge              local
0a843eb27ed9        bridge                  bridge              local
e17d22d0de09        ddev_default            bridge              local
03c2200eb5ed        docker4drupal_default   bridge              local
a64dcc7f1791        dockersal_default       bridge              local
51f880233efb        host                    host                local
a06c56b365f2        none                    null                local

███  DOCKER DESKTOP
EXPECTED VERSION: 2.1.0.5
DETECTED VERSION: 2.4.0.0

███  HDD Usage
Filesystem      Size   Used  Avail Capacity     iused      ifree %iused  Mounted on
/dev/disk1s1   932Gi   10Gi  656Gi     2%      488420 9767489740    0%   /
devfs          232Ki  232Ki    0Bi   100%         802          0  100%   /dev
/dev/disk1s2   932Gi  263Gi  656Gi    29%     2395376 9765582784    0%   /System/Volumes/Data
/dev/disk1s5   932Gi  2.0Gi  656Gi     1%           2 9767978158    0%   /private/var/vm
map auto_home    0Bi    0Bi    0Bi   100%           0          0  100%   /System/Volumes/Data/home
drivefs        932Gi  309Gi  623Gi    34% 18446744069414585123 4294967295 2300092776734985728%   /Volumes/GoogleDrive
/dev/disk1s4   932Gi  504Mi  656Gi     1%          55 9767978105    0%   /Volumes/Recovery
@achekulaev
Copy link
Member

could not create work tree dir 'testing': Permission denied

Could it be that the culprit is that permission is denied? :) Not sure why this issue was opened.

@DonRichards
Copy link
Author

@achekulaev because there was no issues (from what I can see) with my local permissions. I was able to replicate this error on a 2nd machine and thought this "permissions issue" was something within this utility and not a local permissions issue.

@DonRichards
Copy link
Author

This could also be a hint that your instructions/README is incomplete.

@lmakarov
Copy link
Member

@DonRichards it looks like if your user did not have write access on the /Users/admin/Github/ directory, thus git clone fails with an error.

https://stackoverflow.com/questions/36728469/git-clone-fatal-cannot-create-work-tree-dir-permission-denied/54573491

Try this:

cd /Users/admin/Github/
git clone https://github.com/docksal/boilerplate-drupal8-composer --depth=1 -b master drupal8-test1

@DonRichards
Copy link
Author

@lmakarov OK, started from scratch. Cloned it down as you suggested without error, cd into drupal8-test1, and then ran $ fin project create. I tried it within this directory because I just created it with the git command and should be the same user/permissions as the previous commands. But I've done this within an empty directory as well.

Screen Shot 2020-10-23 at 4 03 45 PM

As for the working directory I also have complete write access to it.

Screen Shot 2020-10-23 at 4 04 34 PM

And when I run $ fin project create and this is the results.

Screen Shot 2020-10-23 at 4 05 43 PM

I really don't think this is an issue with my development workflow or local permissions.

@DonRichards
Copy link
Author

I created a test directory and set the permissions to 777 along with /var/www/ and then ran the command with the same results.
Screen Shot 2020-10-23 at 4 20 37 PM
Project Folder is /Users/admin/Github/test but it's cloning to /var/www ? Does that look right?

@devopsean
Copy link

I changed the directory and it worked!

@stevengreg2020
Copy link

┌──(Kali Linus㉿kali)-[~]
└─$ git clone https://github.com/ultrasecurity/Storm-Breaker
cd Storm-Breaker
sudo bash linux-installer.sh
python3 -m pip install -r requirments.txt
sudo python3 Storm-Breaker.py
fatal: destination path 'Storm-Breaker' already exists and is not an empty directory.
[sudo] password for nexphisher:
bash: linux-installer.sh: No such file or directory
/usr/bin/python3: No module named pip
Traceback (most recent call last):
File "/home/nexphisher/Storm-Breaker/Storm-Breaker.py", line 4, in
import pip
ModuleNotFoundError: No module named 'pip'

┌──(Kali Linus㉿kali)-[~/Storm-Breaker]
└─$ git clone https://github.com/ultrasecurity/Storm-Breaker 1 ⨯
fatal: could not create work tree dir 'Storm-Breaker': Permission denied

please can someone help me out on this error how do i solve it i tried to install Storm-Breaker this is what i keep getting

@Hacker960
Copy link

just give it root permission that is type sudo before it .

@marcelo-marcal
Copy link

marcelo-marcal commented Jun 24, 2022

image

Preciso de ajuda!

@vanelo
Copy link

vanelo commented Sep 6, 2022

You need to give permissions to the folder where you are doing git clone.

  • You can create a new directory: mkdir projects
  • Give all access: sudo chmod 777 projects
  • Change directory: cd projects
  • Clone repository: git clone https://github............

@Ajay-Majhi
Copy link

well I'll try

@ReArturo
Copy link

Invalid Argument
Please help me to solve this issue. I downloaded VS Code extension for Github Pull Request. What should I do?

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

No branches or pull requests

10 participants