Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error 550 while removing directory #207

Closed
Matt-17 opened this issue Jul 8, 2021 · 13 comments
Closed

Error 550 while removing directory #207

Matt-17 opened this issue Jul 8, 2021 · 13 comments

Comments

@Matt-17
Copy link

Matt-17 commented Jul 8, 2021

Bug Description
I'm using this action to deploy current version of my app to an ftp. So one subdirectory is 1.0.0.1 then *.2 and so on. When the new version is compiled, the old folder does not exist, so this action tries to delete the old folder after removing every file. While removing the files works, the folder throws an error 550.

While this error is annoying I actually want to keep the old files. How do I achieve this or should I create a new issue?

My Action Config

name: Release Build

on:
  push:
    branches: [ master ]

jobs:
  build:

    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2

[...]

    - name: FTP Deploy
      # You may pin to the exact commit or the version.
      # uses: SamKirkland/FTP-Deploy-Action@d2724c6194d42ae5d4d042070d51d23cbc6ad83f
      uses: SamKirkland/FTP-Deploy-Action@4.1.0
      with:
        server: example.org
        username: ${{secrets.FTPUSER}}
        password: ${{secrets.FTPPASS}}
        local-dir: /bin/Release/app.publish/
        server-dir: Release/
        log-level: verbose

My Action Log

[...]
  file removed
  completed
removing folder "Application Files/2_0_0_23/"
  removing folder "Application Files/2_0_0_23/"
> PWD
< 257 "/Release" is current directory.

> CWD Application Files/2_0_0_23/
< 250 CWD command successful.

> EPSV
< 229 Entering Extended Passive Mode (|||56277|)

> LIST -a
< 150 Opening BINARY mode data connection.

Downloading from 185.64.125.11:56277 (No encryption)
list progress for "". Progress: 0 bytes of 5990926 bytes
list progress for "". Progress: 0 bytes of 5990926 bytes
< 226 Transfer complete.


> CDUP
< 250 CDUP command successful.

> RMD Application Files/2_0_0_23/
< 550 

> CWD /Release
< 250 CWD command successful.


----------------------------------------------------------------
--------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
----------------------------------------------------------------

----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------

FTPError: 550 
    at FTPContext._onControlSocketData (D:\a\_actions\SamKirkland\FTP-Deploy-Action\4.1.0\dist\index.js:3945:39)
    at Socket.<anonymous> (D:\a\_actions\SamKirkland\FTP-Deploy-Action\4.1.0\dist\index.js:3786:44)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:286:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  name: 'FTPError',
  code: 550
}
Error: FTPError: 550 
@hpohlmeyer
Copy link

I think I have a similar problem. I have a cache folder, that is stored under a folder with the hash name (YCiIk-L5RdA4md0bJOcVZ) in this case:

.
├── _next
│   ├── YCiIk-L5RdA4md0bJOcVZ
│   ├── data
│   │   └── YCiIk-L5RdA4md0bJOcVZ
│   │       ├── about.json
│   │       ├── imprint-and-privacy-policy.json
│   │       ├── index.json
│   │       └── projects
│   │           └── …
│   └── static
│       ├── YCiIk-L5RdA4md0bJOcVZ
│       │   ├── _buildManifest.js
│       │   └── _ssgManifest.js
│       └── chunks
│           ├── 152-7ab1abc6c13d3235b855.js
│           ├── 359.cc8d6f69960526617398.js
│           ├── 692-7146eebd06f6e375df5e.js
│           ├── 880-215c3aaf15f82682a5c6.js
│           ├── framework-92300432a1172ef1338b.js
│           ├── main-63764e6f798785fe32b6.js
│           ├── pages
│           │   ├── 404-e01b388652e7d5730748.js
│           │   ├── _app-e48ce355075a9938b0ee.js
│           │   ├── _error-29c4e2af0a284d96407a.js
│           │   ├── about-82ce9b20276feb313d46.js
│           │   ├── imprint-and-privacy-policy-d75fb0cba6f07b8c1cba.js
│           │   ├── index-8998c85b0d2a196dfe67.js
│           │   └── projects
│           │       └── [slug]-83c2d93795751aa4f2bc.js
│           ├── polyfills-a54b4f32bdc1ef890ddd.js
│           └── webpack-f4a8f7398bdb7252be2d.js

The next upload has a similar structure, but with a different hash. The action correctly detects, that the outdated cache folder should be deleted, but throws a 550 error, when it tries to remove the folder, after all files inside it have been removed.

removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file1.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file2.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file3.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file4.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file5.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file6.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file7.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file8.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file9.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file10.json"
removing "_next/data/YCiIk-L5RdA4md0bJOcVZ/projects/file11.json"
removing "_next/static/chunks/pages/about-155d6618472435777b04.js"
removing "_next/static/YCiIk-L5RdA4md0bJOcVZ/_buildManifest.js"
removing "_next/static/YCiIk-L5RdA4md0bJOcVZ/_ssgManifest.js"
removing folder "_next/data/YCiIk-L5RdA4md0bJOcVZ/"

----------------------------------------------------------------
--------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
----------------------------------------------------------------

----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------

FTPError: 550 Can't remove directory: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3945:39)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3786:44)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:286:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  name: 'FTPError',
  code: 550
}

The folder is empty, but still exists on the server. Deleting it manually works just fine. Might there be a problem with deleting empty folders?

@jdiazgon55
Copy link

This error is also being thrown in my case when I upgraded from version 4.0.0 to version 4.1.0, so I decided to revert my upgrade meanwhile:

removing "bin/console"
File not found or you don't have access to the file - skipping...
removing "bin/phpunit"
File not found or you don't have access to the file - skipping...

FTPError: 550 Can't change directory to bin/: No such file or directory
    at FTPContext._onControlSocketData (D:\a\_actions\SamKirkland\FTP-Deploy-Action\4.1.0\dist\index.js:3945:39)
    at Socket.<anonymous> (D:\a\_actions\SamKirkland\FTP-Deploy-Action\4.1.0\dist\index.js:3786:44)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:286:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  name: 'FTPError',
  code: 550
}
Error: FTPError: 550 Can't change directory to bin/: No such file or directory

@maciejkorsan
Copy link

there's an error with going up to the main directory

@christrunk
Copy link

Agreed. Same here. When it deletes the parent folder "Testfolder" it then complains is can't find "Testfolder/childfolder" and 550's

@dipras
Copy link

dipras commented Jul 27, 2021

Yep
I also had similliar error

@MartijntenCaat
Copy link

Same here.

@toui0411
Copy link

toui0411 commented Aug 3, 2021

This may be a known fact, but...

I was able to avoid the error by setting the "dangerous-clean-slate" option to "true".

I think this is because the server's files are deleted first.

@jorgsiegel
Copy link

Same error here. We are using FTP-Deploy-Action with Gatsby. It seems that it throws an error when trying to access (or delete?) an empty folder. Would be nice to have this fixed as right now we can't use automatic deployment because of this bug...

@Penguibird
Copy link

I have fixed a similar issue that was happening to me in this fork, if you want to test this out. I'd be happy to help you if you have any issues with mine too.
https://github.com/Penguibird/FTP-Deploy-Action

@jdiazgon55
Copy link

if you want to test this out. I'd be happy to help you if you have any issues with mine too.

Thanks, I am actually having a similar issue using your version.

Making changes to 2 files/folders to sync server state
Uploading: 0 B -- Deleting: 0 B -- Replacing: 1.5 kB
----------------------------------------------------------------
replacing "README.md"
removing folder "public/img/"

----------------------------------------------------------------
--------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
----------------------------------------------------------------

----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------

FTPError: 550 Can't remove directory: No such file or directory
    at FTPContext._onControlSocketData (D:\a\_actions\Penguibird\FTP-Deploy-Action\4.2.0\dist\index.js:3945:39)
    at Socket.<anonymous> (D:\a\_actions\Penguibird\FTP-Deploy-Action\4.2.0\dist\index.js:3786:44)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:286:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  name: 'FTPError',
  code: 550
}
Error: FTPError: 550 Can't remove directory: No such file or directory

The interesting thing is that the folder public/img should be excluded from my config:

    steps:
      - uses: actions/checkout@v2

      - name: Desplegar backend a SiteGround 
        uses: Penguibird/FTP-Deploy-Action@4.2.0
        with: 
          server: easyfresh.tk
          username: ${{ secrets.ftp_username}
          password: ${{ secrets.ftp_password }}
          server-dir: RestAPI/
          exclude: .git*
            - .git*/**
            -  **/.git*/**
            - vendor/**
            - vendor/**/*
            - public/archivos_docs/**
            - public/archivos_mensajes/**
            - public/img_grupos_chat/**
            - public/img/**

@Penguibird
Copy link

I had a similar issue so in version 4.2.1, I added one more try catch block around the remove folder method, so test that out.

@SamKirkland
Copy link
Owner

@Matt-17 it looks like this ticket got a bit off topic. I will work on the directory removal bug soon. But in your case I recommend your dynamically change which folder you're deploying to. The server-path can simply be changed based on your deploy.

For example (note: untested code)

name: Release Build
on:
  push:
    tags:
      - 'v*.*.*' # note this line has changed. Anything with a tag following this pattern will run this deploy
jobs:
  build:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2

    - name: Set env
       run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
    - name: FTP Deploy
      uses: SamKirkland/FTP-Deploy-Action@4.1.0
      with:
        server: example.org
        username: ${{secrets.FTPUSER}}
        password: ${{secrets.FTPPASS}}
        local-dir: /bin/Release/app.publish/
        server-dir: Release/$RELEASE_VERSION/
        log-level: verbose

Example is a modified version of https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions

@SamKirkland
Copy link
Owner

As for those with the folder issues, I'm going to be using issue #220 for tracking this as its more on-topic.

Marking as duplicate of #220

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

No branches or pull requests