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

Syncing won't download files from container #630

Closed
vroad opened this issue Aug 8, 2019 · 8 comments
Closed

Syncing won't download files from container #630

vroad opened this issue Aug 8, 2019 · 8 comments
Assignees
Labels
area/sync Issues related to the real-time code synchronization kind/bug Something isn't working

Comments

@vroad
Copy link

vroad commented Aug 8, 2019

What happened?
Syncing upload files from local computer, but won't download files from container.

What did you expect to happen instead?
devspace download files from container as well.

How can we reproduce the bug? (as minimally and precisely as possible)
I tried syncing with phpfpm container

Local Environment:

  • Operating System: windows
  • Deployment method: helm

Kubernetes Cluster:

  • Cloud Provider: none
  • Kubernetes Version: Client: v1.14.3, Server: v1.15.2

Anything else we need to know?
minikube v1.3.0
devspace 3.5.12

I couldn't try 3.5.14 because both syncing and build is broken:

[info]   Loaded config from devspace.yaml
ERRO[0007] Can't add file *FILE_PATH* to tar: io: read/write on closed pipe
ERRO[0007] Can't close tar writer: io: read/write on closed pipe
ERRO[0016] Can't add file *FILE_PATH* to tar: io: read/write on closed pipe
ERRO[0016] Can't close tar writer: io: read/write on closed pipe
[fatal]  Error building image: Error building image my-app/elasticsearch:latest: Info: Building image 'my-app/elasticsearch' with engine 'docker'
 Error during image build: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39

/kind bug

@FabianKramm FabianKramm self-assigned this Aug 8, 2019
@FabianKramm FabianKramm added area/building-images Issues related to building Docker images kind/bug Something isn't working priority/critical labels Aug 8, 2019
@FabianKramm
Copy link
Collaborator

FabianKramm commented Aug 8, 2019

@vroad thanks for reporting this issue!

Regarding the fatal error in the newest version, I already fixed this and will rollout a new version pretty soon, thanks for finding and reporting this.

Regarding the sync issue, it works for me with the php:7.1.31-fpm image. Could you share your devspace.yaml?

In order for me to understand what could have gone wrong could you please also execute the following commands in two separate terminals:

  • Run command devspace sync -n yournamespace --pod yourpod --container-path /remote/path/that/you/want/to/sync in the folder that you want to sync with the remote container
  • Run command devspace enter -n yournamespace --pod yourpod and create a new file remotely within this shell in the --container-path you have specified

Then send the output of the first command here please.

@vroad
Copy link
Author

vroad commented Aug 8, 2019

Actually the command I used was devspace dev.
With devspace sync, sync worked as I expected. The image was php:7.2-fpm, but I doubt if the version has to do with the problem.

[info]   Start syncing
[done] √ Sync started on C:\path\to\my-app <-> /var/www/html (Pod: default/my-app-855b76f994-rvmhh)
[info]   Downstream - Download 9110 files (size: 34379038)
[info]   Upstream - Upload 975 create changes (size 6222188)
[info]   Upstream - Successfully processed 975 change(s)
[info]   Downstream - Untared 500 files...
[info]   Downstream - Untared 1000 files...
[info]   Downstream - Untared 1500 files...
[info]   Downstream - Untared 2000 files...
[info]   Downstream - Untared 2500 files...
[info]   Downstream - Untared 3000 files...
[info]   Downstream - Untared 3500 files...
[info]   Downstream - Untared 4000 files...
[info]   Downstream - Untared 4500 files...
[info]   Downstream - Untared 5000 files...
[info]   Downstream - Untared 5500 files...
[info]   Downstream - Untared 6000 files...
[info]   Downstream - Untared 6500 files...
[info]   Downstream - Untared 7000 files...
[info]   Downstream - Untared 7500 files...
[info]   Downstream - Untared 8000 files...
[info]   Downstream - Untared 8500 files...
[info]   Downstream - Untared 9000 files...
[info]   Downstream - Successfully processed 9110 change(s)
[info]   Initial sync completed
[info]   Downstream - Download file /foo, size: 0
[info]   Downstream - Successfully processed 1 change(s)

@FabianKramm
Copy link
Collaborator

@vroad thanks for the output! The advantage of devspace sync is that you can see directly what the sync is doing (with devspace dev the sync log will be in .devspace/logs/sync.log but the command is essentially doing the exact same as the devspace sync command in the background). Can you provide me the sync config in your devspace.yaml?

@FabianKramm FabianKramm added area/sync Issues related to the real-time code synchronization needs-information Indicates an issue needs more information to work on it and removed area/building-images Issues related to building Docker images kind/bug Something isn't working priority/critical labels Aug 8, 2019
@LukasGentele
Copy link
Contributor

@vroad: Does the issue still exists when using the latest version of DevSpace? If yes, please provide further details on the sync configuration within your devspace.yaml.

@vroad
Copy link
Author

vroad commented Aug 21, 2019

dev:
  terminal:
    labelSelector: &phpfpm-pod-selector
      app: my-app
      service: web-server
    containerName: &container-name my-app-phpfpm
  sync:
    - labelSelector: *phpfpm-pod-selector
      containerName: *container-name
      localSubPath: ./
      excludePaths:
        - .git/
        - .devspace/
        - var/

I've tried devspace version 3.5.16 and the issue still exists.

@FabianKramm FabianKramm removed their assignment Aug 21, 2019
@FabianKramm

This comment has been minimized.

@FabianKramm
Copy link
Collaborator

FabianKramm commented Aug 21, 2019

@vroad I found the problem. The php-fpm container default working directory is /var/www/html and we have a bug on the server side with the exclude paths that they are not applied relative to the working directory. Hence the exclude path var/ from your sync config will exclude all files from the folder /var/www/html and you don't see any files downloading.

I will fix this and add this to the next release, which will come out today or tomorrow

@FabianKramm FabianKramm added kind/bug Something isn't working priority/critical and removed needs-information Indicates an issue needs more information to work on it labels Aug 21, 2019
@FabianKramm FabianKramm self-assigned this Aug 21, 2019
FabianKramm added a commit that referenced this issue Aug 21, 2019
@FabianKramm
Copy link
Collaborator

Should be fixed in v3.5.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync Issues related to the real-time code synchronization kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants