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

docker can't access to volume with screen #4822

Closed
2 tasks done
joseluisbz opened this issue Jul 31, 2020 · 36 comments
Closed
2 tasks done

docker can't access to volume with screen #4822

joseluisbz opened this issue Jul 31, 2020 · 36 comments

Comments

@joseluisbz
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: BFD655CF-D206-4905-B5AD-06447A5E3DDF/20200731174034

Expected behavior

Allows to acces by terminal to tty related to docker

Actual behavior

% screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty                
[screen is terminating]
%

Information

  - macOS Version: 10.15.6

Diagnostic logs

 - Docker for Mac: version 2.3.0.4

Steps to reproduce the behavior

  1. open Terminal
  2. screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
@dpkirchner
Copy link

You can get slightly further if you run chmod 777 ~/Library/Containers/com.docker.docker/Data/vms/0/tty and run screen -m -L ~/Library/Containers/com.docker.docker/Data/vms/0/tty. In that case you'll see this in the screenlog.0 file (created by the -L flag):

/Users/dpk/Library/Containers/com.docker.docker/Data/vms/0/tty: line 1: /dev/ttys001: Permission denied

I haven't figured out how to run screen without the tty to fix the buggy permissions there.

This bug also affects version 2.3.5.0 (edge channel). I uploaded a diagnostic log as well: D7716AFD-F809-46C0-9AB4-2EE25C4697EB/20200824172454

@ibalashov
Copy link

@dpkirchner I did the command above screen -m -L and got the following:

$ cat screenlog.0
/dev/ttys005

But not sure how to proceed. Docker 2.3.0.4.

@dpkirchner
Copy link

I'm not sure, you got a lot further along than I did. FWIW, I run in to exactly the same bug in 2.3.0.4 as I did in 2.3.5.0.

There's a StackOverflow comment about the issue suggesting a solution that may work for some cases: https://stackoverflow.com/a/60582083 It doesn't work for my specific use case, unfortunately, but it might help you out.

@hnkhuy
Copy link

hnkhuy commented Sep 13, 2020

I met this issue on 2.3.0.4(46911) too. And the log is:
/Users/huyhuynh/Library/Containers/com.docker.docker/Data/vms/0/tty: line 1: /dev/ttys004: Permission denied
I tried chmod 400 , chmod 777 and sudo in front also not work :'(

@stevegoossens
Copy link

Until this is fixed, here are two workaround methods that worked for me: https://stackoverflow.com/a/63595817/1456285

@jenildesai25
Copy link

I have tried using method 1 from above link -> https://stackoverflow.com/a/63595817/1456285

I did enter into terminal but after that how to navigate?

@stevegoossens
Copy link

Once you have terminal access to the VM, you can find the volume data in the usual place, i.e. /var/lib/docker/volumes, with subfolders for each docker volume, and _data subfolders therein for the actual data, e.g.

docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
/ # ls -lah /var/lib/docker/volumes/
total 72
drwx------   10 root     root        4.0K Aug 27 11:34 .
drwx--x--x   15 root     root        4.0K Oct  9 16:07 ..
drwxr-xr-x    3 root     root        4.0K Aug 26 10:44 14ce94e174839f1947efa6fcbf5ac1fb2ea3b0f0b3f25311fee333ee374576b6
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 34eb2bd80931ff954e1da80c5383beb4def61129d4005432b77080531cd10a5a
drwxr-xr-x    3 root     root        4.0K Aug 27 11:34 830de2ce31519c921b50c448964b54517ca4461d337b56a9fd6e5b354ace3247
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 data-layer_mongo_data
drwxr-xr-x    3 root     root        4.0K Aug 26 11:01 ebb440184703bfad17184bd5ff74b677b50d74b8f0fbdd116506a1fcacfb00cd
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_back-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_front-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_mongo_data
-rw-------    1 root     root       64.0K Oct  9 16:07 metadata.db
/ # ls -lah /var/lib/docker/volumes/data-layer_mongo_data/_data/
total 1352
drwxr-xr-x    4 999      ping        4.0K Aug 27 11:35 .
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 ..
-rw-------    1 999      ping          46 Aug 25 12:34 WiredTiger
-rw-------    1 999      ping          21 Aug 25 12:34 WiredTiger.lock
-rw-------    1 999      ping        1.2K Aug 27 11:35 WiredTiger.turtle
-rw-------    1 999      ping       84.0K Aug 27 11:35 WiredTiger.wt
-rw-------    1 999      ping        4.0K Aug 27 11:35 WiredTigerLAS.wt
-rw-------    1 999      ping       20.0K Aug 27 11:35 _mdb_catalog.wt
-rw-------    1 999      ping       20.0K Aug 27 11:35 collection-0--6268495467305357123.wt
-rw-------    1 999      ping      388.0K Aug 25 12:34 collection-10--6268495467305357123.wt
-rw-------    1 999      ping      132.0K Aug 26 10:14 collection-12--6268495467305357123.wt
-rw-------    1 999      ping      264.0K Aug 26 10:14 collection-14--6268495467305357123.wt
-rw-------    1 999      ping       36.0K Aug 27 11:35 collection-2--6268495467305357123.wt
-rw-------    1 999      ping       24.0K Aug 26 10:14 collection-4--6268495467305357123.wt
-rw-------    1 999      ping       28.0K Aug 25 12:34 collection-8--6268495467305357123.wt
drwx------    2 999      ping        4.0K Aug 27 11:35 diagnostic.data
-rw-------    1 999      ping       20.0K Aug 27 11:35 index-1--6268495467305357123.wt
-rw-------    1 999      ping       40.0K Aug 25 12:34 index-11--6268495467305357123.wt
-rw-------    1 999      ping       60.0K Aug 26 10:14 index-13--6268495467305357123.wt
-rw-------    1 999      ping       64.0K Aug 25 13:47 index-15--6268495467305357123.wt
-rw-------    1 999      ping       36.0K Aug 27 11:35 index-3--6268495467305357123.wt
-rw-------    1 999      ping       24.0K Aug 26 10:14 index-5--6268495467305357123.wt
-rw-------    1 999      ping       12.0K Aug 27 11:35 index-6--6268495467305357123.wt
-rw-------    1 999      ping       24.0K Aug 25 12:34 index-9--6268495467305357123.wt
drwx------    2 999      ping        4.0K Aug 26 10:15 journal
-rw-------    1 999      ping           0 Aug 27 11:35 mongod.lock
-rw-------    1 999      ping       36.0K Aug 27 11:35 sizeStorer.wt
-rw-------    1 999      ping         114 Aug 25 12:34 storage.bson
/ # exit

@gmbulaba
Copy link

gmbulaba commented Oct 15, 2020

Hello
am facing a other issue when trying : screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
i have a message saying No such file or directory and [screen is terminating] after

here is the way am running my docker :
docker run -tid --name web -p 8080:80 --mount source=myvolume, target=/usr/share/nginx/html nginx:latest

I don't get why tty is not found. Can someone help me ?

@fireinrain
Copy link

I also get this issue.
computer: mac
os version 10.14.6
dokcer for mac version 2.4.0.0(48506)
image

when i want to attach into the docker vm, i run the command mentioned in this page. i get the same error.

it warn me that screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty permission denied.

in the early version docker for mac desktop, it can work.

is it a bug, hope to fix, thanks

@deepio-oc
Copy link

deepio-oc commented Nov 14, 2020

I also don't have tty file.

ls -l ~/Library/Containers/com.docker.docker/Data/vms/0/tty 
ls: /Users/xxx/Library/Containers/com.docker.docker/Data/vms/0/tty: No such file or directory

docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 16:58:31 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

@sangshuduo
Copy link

I don't have the tty file too. I'm using latest docker desktop 2.5.0.1 for mac.

@Skyler1017
Copy link

I don't have the tty file too.

@rizkiiansyah
Copy link

Me too

@rockcyj
Copy link

rockcyj commented Nov 27, 2020

I still met this issue now and my docker desktop version is: 2.5.0.1 (49550) and Channel: stable.

@dazhuaoyao
Copy link

dazhuaoyao commented Nov 28, 2020

met this issue too:

docker version
Client: Docker Engine - Community
Cloud integration: 1.0.2
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 16:58:31 2020
OS/Arch: darwin/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:07:04 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

@ricky1uphealth
Copy link

Looks like they changed it to a button "CLI" in the UI see my post / img here https://stackoverflow.com/a/65203563/1484447

@kamilcglr
Copy link

I don't have the tty file too. I'm using latest docker desktop 2.5.0.1 for mac.

Hello, did you find a solution ?

@rockcyj
Copy link

rockcyj commented Jan 2, 2021

I don't have the tty file too. I'm using latest docker desktop 2.5.0.1 for mac.

Hello, did you find a solution ?

A workaround works for me: https://rocky-chen.medium.com/docker-unable-to-access-to-volume-with-screen-for-mac-9d016f5420e6

@RicHincapie
Copy link

RicHincapie commented Jan 9, 2021

I don't have tty either:

Client: Docker Engine - Community
Cloud integration: 1.0.4
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:12:42 2020
OS/Arch: darwin/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:23 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0

But there's a few good news here for you based on #4822 (comment) and in VsCode!
https://stackoverflow.com/a/65645462/12882771

@conor-mooney
Copy link

If you can't find your tty, it maybe because you can no longer screen into the Docker Vm on macOS. The following solution worked for me:

https://stackoverflow.com/questions/63445657/why-i-am-getting-screen-is-terminating-error-in-macos/63595817#63595817

I used "method 1":

docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh

I'm on Docker 20.10.2 and macOS: 10.17.7

@prologic
Copy link

I can confirm the same bug and work-around here on my Docker for MacOS

(⎈ |local:default)
prologic@Jamess-iMac
Fri Feb 26 12:18:38
~
 130
$ docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
/ # sysctl -w vm.dirty_expire_centisecs=20000
vm.dirty_expire_centisecs = 20000
/ #

Relevant versions:

  • macOS Catalina 10.15.7
  • Docker for Mac 3.1.0

@joebnb
Copy link

joebnb commented Apr 26, 2021

same issue

Hello
am facing a other issue when trying : screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
i have a message saying No such file or directory and [screen is terminating] after

here is the way am running my docker :
docker run -tid --name web -p 8080:80 --mount source=myvolume, target=/usr/share/nginx/html nginx:latest

I don't get why tty is not found. Can someone help me ?

i have same issue

@TomMonkeyMan
Copy link

Me too! no tty file.

@yangzi-jiang
Copy link

Ran into the same issue, when I'm trying to fix another issue #1396

@djong0
Copy link

djong0 commented Aug 31, 2021

With no tty file.
This is useful: https://gist.github.com/BretFisher/5e1a0c7bcca4c735e716abf62afad389

@FakieKickflip
Copy link

Is there a solution?

@tolumide-ng
Copy link

😪

@Lepkem
Copy link

Lepkem commented Nov 23, 2021

there is still no fix

@ghost
Copy link

ghost commented Nov 30, 2021

🥲 Some workarounds: https://stackoverflow.com/a/36330903 https://stackoverflow.com/a/55648186
😫 Some hacks (mentioned by @djong0 above): https://gist.github.com/BretFisher/5e1a0c7bcca4c735e716abf62afad389
😡 Possible alternative to Docker Deskstuff: #6065

@xros
Copy link

xros commented Jan 18, 2022

Having the same problem.
On M1 Mac, Apple Silicon version Docker: 4.4.2
Docker needs to give us a nice solutions on MacOS.

add this in .zshrc
dockervm () { docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh }
then
source ~/.zshrc && dockervm
then find volumes
ls /var/lib/docker/volumes

@Oscaner
Copy link

Oscaner commented Mar 2, 2022

Having the same problem. On M1 Mac, Apple Silicon version Docker: 4.4.2 Docker needs to give us a nice solutions on MacOS.

add this in .zshrc dockervm () { docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh } then source ~/.zshrc && dockervm then find volumes ls /var/lib/docker/volumes

Additional:
Add this in .zshrc
alias dockervm="docker start dockervm_instance -i || docker run --name=dockervm_instance -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh"

This doesn't create the container over and over again.

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@joseluisbz
Copy link
Author

joseluisbz commented Jun 3, 2022

In order to prevent /remove-lifecycle /remove-lifecycle state /lifecycle frozen /lifecycle frozen

@KGB1st
Copy link

KGB1st commented Jun 7, 2022

have same problem can't run screen for my program, on volume..
screen -mS "GGWP" "srcds_linux -game csgo -console"
separated only command srcds_linux started, but when I tried to sart it with args, have issue 'no such file or dir'

p.s. sorry problem for linux (not for clear mac)

@mcabreb
Copy link

mcabreb commented Jul 27, 2022

/remove-lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests