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: FTPError: 550 Remove directory operation failed. #220

Closed
iwyang opened this issue Aug 18, 2021 · 51 comments · Fixed by #265
Closed

Error: FTPError: 550 Remove directory operation failed. #220

iwyang opened this issue Aug 18, 2021 · 51 comments · Fixed by #265

Comments

@iwyang
Copy link

iwyang commented Aug 18, 2021

FTPError: 550 Remove directory operation failed.
at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3945:39)
at Socket. (/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
}
Error: FTPError: 550 Remove directory operation failed.

@Penguibird
Copy link

I have fixed this issue in this fork, if you want to test this out.
https://github.com/Penguibird/FTP-Deploy-Action

@Sang-HL
Copy link

Sang-HL commented Sep 9, 2021

i guess action is using yours @Penguibird, but still same error msg...

Run Penguibird/FTP-Deploy-Action@4.2.1

🚀 Thanks for using ftp-deploy. Let's deploy some stuff!

removing folder "just_engine/lib/temp/"


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


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

FTPError: 550 Directory not found
at FTPContext._onControlSocketData (/home/runner/work/_actions/Penguibird/FTP-Deploy-Action/4.2.1/dist/index.js:3945:39)
at Socket. (/home/runner/work/_actions/Penguibird/FTP-Deploy-Action/4.2.1/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 Directory not found

@florindobre90
Copy link

i have the same issue ?
any updates ?

@Udik
Copy link

Udik commented Sep 23, 2021

I also have the same issue (failed to remove empty folders after removing all their contents). Also, it seems that in the case it aborts without writing the new (partial) sync state to the server, which seems to be dangerous.

@shehan96
Copy link

shehan96 commented Oct 8, 2021

i have the same issue ?
any updates ?

@danielpardamean
Copy link

i have the same issue ? any updates ?

Me too, hope this will be fixed soon

@Trainax
Copy link
Contributor

Trainax commented Oct 15, 2021

I also encountered this problem when I renamed a folder and committed the changes.

The file structure was like this:

\main_folder
    \subfolder1
    \subfolder2

When I gave the main_folder a new name, a new folder with the same contents but the new name was created on the server. After this the files inside the subfolders of the main_folder were deleted and then the subfolders themselves were also deleted. When it came time to delete the main_folder from the server, error 550 happened.

I fixed this error by connecting to the server using FileZilla FTP Client, manually deleting that folder and also the .ftp-deploy-sync-state.json file and then triggering a new complete sync which finished correctly

@lpldev
Copy link

lpldev commented Oct 18, 2021

hello @Trainax, sorry if it's a dumb question, but i don't get it: How do you manage to do a 'new complete sync'? I was re-running the action but i'm getting the same response. And also, what is this 'sync state json' you told in your answer?

@Trainax
Copy link
Contributor

Trainax commented Oct 18, 2021

hello @Trainax, sorry if it's a dumb question, but i don't get it: How do you manage to do a 'new complete sync'? I was re-running the action but i'm getting the same response. And also, what is this 'sync state json' you told in your answer?

Inside the directory on the server where this action syncs the files to you can find a file called .ftp-deploy-sync-state.json (unless you have changed the name or location of this file using the state-name option) the action uses to keep track of what files have been synced and when.

If you connect to the server using an FTP client and delete this file, when you run again this action all the files in the repo will be synced again to the server even if they have not been modified

@azzzub
Copy link

azzzub commented Oct 19, 2021

Since it doesn't fix yet, use version 4.0.0 instead of 4.1.0. SamKirkland/FTP-Deploy-Action@4.0.0. I think the issue is on the ftp-deploy dependency, since its version upgraded to 1.1.0, still looking forward 👁️

@lpldev
Copy link

lpldev commented Oct 19, 2021

Understood, thanks @Trainax and @azzzub

@gavrichards
Copy link

It looks like there has been a commit which fixes this and marked as 4.2.0 beta, but no release as of yet. Does anyone know if it's possible to use this?

@Penguibird
Copy link

Penguibird commented Oct 20, 2021 via email

@JamesDelfini
Copy link

JamesDelfini commented Nov 5, 2021

Since it doesn't fix yet, use version 4.0.0 instead of 4.1.0. SamKirkland/FTP-Deploy-Action@4.0.0. I think the issue is on the ftp-deploy dependency, since its version upgraded to 1.1.0, still looking forward 👁️

Thanks for this, downgrading to lower versions works.

@timocouckuyt
Copy link

timocouckuyt commented Nov 23, 2021

Still not OK in 4.2.0. See shot below. Created a testfile.txt in a testfolder and removed the folder afterwards:

image

@SamKirkland Are you able to replicate this?

PS: The file gets removed, but the remaining empty folder doesn't.

// T

@timocouckuyt
Copy link

Since it doesn't fix yet, use version 4.0.0 instead of 4.1.0. SamKirkland/FTP-Deploy-Action@4.0.0. I think the issue is on the ftp-deploy dependency, since its version upgraded to 1.1.0, still looking forward 👁️

In version 4.0.0 files get removed, folder remains but doesn't throw a 550 error. So it's still an issue.

@timocouckuyt
Copy link

Since it doesn't fix yet, use version 4.0.0 instead of 4.1.0. SamKirkland/FTP-Deploy-Action@4.0.0. I think the issue is on the ftp-deploy dependency, since its version upgraded to 1.1.0, still looking forward 👁️

Thanks for this, downgrading to lower versions works.

Which version?

@ApplecakeYT
Copy link

Since it doesn't fix yet, use version 4.0.0 instead of 4.1.0. SamKirkland/FTP-Deploy-Action@4.0.0. I think the issue is on the ftp-deploy dependency, since its version upgraded to 1.1.0, still looking forward 👁️

Thanks for this, downgrading to lower versions works.

Which version?

Version 4.0.0

@timocouckuyt
Copy link

timocouckuyt commented Dec 7, 2021

@ApplecakeYT Version 4.0.0 fails silently, see my reply above: #220 (comment)

@gavrichards
Copy link

I really wish this was fixed, it's such a pain in the ass when you do a big deployment, and then near the end it fails because some directories were deleted, so you then have to redeploy the entire repo to get the "sync state" file up to date.

@ApplecakeYT
Copy link

@ApplecakeYT Version 4.0.0 fails silently, see my reply above: #220 (comment)

I am aware, although thanks for pointing it out. I should have mentioned that it only hides the error rather than actually fixing it.

@Kryptos-FR
Copy link

I had a similar error today. One issue is that removal should happen in reverse order.

In my case it tried to do this:

📁 Delete: jekyll
📁 Delete: jekyll/update
📁 Delete: jekyll/update/2022
📁 Delete: jekyll/update/2022/01
📁 Delete: jekyll/update/2022/01/14

And because jekyll was deleted first (including all its sub folder and files) it failed for the next step:

removing folder "jekyll/"
removing folder "jekyll/update/"


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


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

FTPError: 550 Can't change directory to update/: No such file or directory

What the action should do is remove in deep-first order:

📁 Delete: jekyll/update/2022/01/14
📁 Delete: jekyll/update/2022/01
📁 Delete: jekyll/update/2022
📁 Delete: jekyll/update
📁 Delete: jekyll

@Tsioriantenaina
Copy link

Hello,
Don't know if this can help someone but on my end, I have resolve this to add this line: dangerous-clean-slate: true
This line remove all file in server directory before upload the new file.

image

Hope that this can help :)

@raparthur
Copy link

After long searching, now in Jan/2022 I arrived at conclusion that unfortunatelly this issue still has no solution as should be, but I will follow a short routine which does the trick:

Execute push normally. This will throw the expected FTP 550 error, but will update your repository.
Delete manually ftp-deploy-sync-state.json file on FTP server root
Delete manually the undesired directory located on FTP server
Change something and run push again.

@vanderHobus
Copy link

Apparently it's an FTP user permission error.
My FTP is on an IIS server, I added permission to the user who makes the connection through IIS, and the problem stopped happening.

To test, use FileZilla (for example), login with the same login/password and try to create a folder through filezilla. Check for a permission error.

@SamKirkland
Copy link
Owner

I've pushed v4.3.0-beta branch with a fix for this bug.
For those of you willing to test this bug fix update the uses: line in your action yaml file to the following

uses: SamKirkland/FTP-Deploy-Action@v4.3.0-beta

Please follow up with a comment letting me know if the issue has been resolved.

Note: Once I deploy the actual 4.3.0 branch you will need to update your yaml files again as the beta branch will be destroyed.

@timocouckuyt
Copy link

timocouckuyt commented Jan 31, 2022

@SamKirkland Fix works here. I performed the following:

  • Created a folder with one file in it. Pushed it. Got deployed fine.
  • Removed the exact same folder, including the file. Got removed fine on the server without the 550 error.

👍🏻

@afbora
Copy link

afbora commented Feb 2, 2022

@SamKirkland Yes, I can confirm too, removing directory works for @v4.3.0-beta 👏

redelmann added a commit to edunumsec2/book that referenced this issue Feb 4, 2022
Upgrade FTP-Deploy-Action version to fix the build error. See SamKirkland/FTP-Deploy-Action#220
redelmann added a commit to edunumsec2/book that referenced this issue Feb 4, 2022
Upgrade FTP-Deploy-Action to fix error when deploying book to FTP server. See SamKirkland/FTP-Deploy-Action#220
@gitinthehole
Copy link

@SamKirkland Didn't have a chance to test this until now. Wanted to say thanks much. The latest update v4.3.0 works like a charm.

@joshigolu08
Copy link

I slove this using uses: SamKirkland/FTP-Deploy-Action@4.3.0
just change the version

@LOO2
Copy link

LOO2 commented May 15, 2022

O solve this excluding the folder error like:
exclude: | **/.vscode* **/.circleci* **/.git* **/.git*/** **/node_modules/**

I hope I've helped!

@attilaimre99
Copy link

For me the problem was that my cPanel hosting doesn't allow foreign FTP connections by default and I had to allow it manually.

@frontcamp
Copy link

I slove this using uses: SamKirkland/FTP-Deploy-Action@4.3.0 just change the version

Same thing - helped me to just change version and error "Can't delete file or folder" was lost. Thank you!

@davetapley
Copy link

davetapley commented Jan 11, 2023

I just got this on 4.3.0 😞

If it helps:
I deleted the contents of a dir called Radar, then in a later commit recreated it as radar with a single new file, before pushing both commits. It failed with:

replacing "tasks/radar/ncToImage.py"
...
FTPError: 550 The system cannot find the path specified. 

@adampweb
Copy link

The issue still exists 😞

Bug Description

My result is similar for the followings:
#369 (comment)
#220

Here you wrote that you fixed the issue in the 4.3.0-beta version. But the latest version(4.3.4)still has the issue.

My Action Config

name: 🚀 Deploy Site to cPanel
on:
  push:
    branches:
      - main

permissions:
  contents: read

jobs:
  FTP-Deploy-Action:
    name: 🎉 Deploy
    runs-on: ubuntu-latest

    steps:
      - name: 🚚 Get the latest code
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: Use Node.js 16
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Cache npm dependencies
        uses: actions/cache@v3
        id: cache-node-modules
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

      - name: 🔨 Install Dependencies
        if: steps.npm-cache.outputs.cache-hit != 'true'
        run: |
          npm install
          npm prune
          npm run build --if-present
          git reset --hard

      - name: 📂 Sync folders and files to the server
        uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: ${{ secrets.FTP_SERVER }}
          username: ${{ secrets.FTP_USERNAME }}
          password: ${{ secrets.FTP_PASSWORD }}

My Action Log

Run SamKirkland/FTP-Deploy-Action@v4.3.4
----------------------------------------------------------------
🚀 Thanks for using ftp-deploy. Let's deploy some stuff!   
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a ⭐ on Github --> https://github.com/SamKirkland/FTP-Deploy-Action
or add a badge 🏷️ to your projects readme --> https://github.com/SamKirkland/FTP-Deploy-Action#badge
----------------------------------------------------------------
Last published on 📅 Friday, June 9, 2023, 4:17 PM
----------------------------------------------------------------
Local Files:  114
Server Files: 114
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
📁 Create: _next/static/_RfaoSevEUUzn1m-yNWNm
📄 Upload: _next/static/_RfaoSevEUUzn1m-yNWNm/_buildManifest.js
📄 Upload: _next/static/_RfaoSevEUUzn1m-yNWNm/_ssgManifest.js
🔁 File replace: _next/BUILD_ID
🔁 File replace: _next/build-manifest.json
🔁 File replace: _next/cache/.tsbuildinfo
🔁 File replace: _next/cache/config.json
🔁 File replace: _next/cache/eslint/.cache_metchw
🔁 File replace: _next/cache/next-server.js.nft.json
🔁 File replace: _next/cache/webpack/client-production/0.pack
🔁 File replace: _next/cache/webpack/client-production/index.pack
🔁 File replace: _next/cache/webpack/server-production/0.pack
🔁 File replace: _next/cache/webpack/server-production/index.pack
🔁 File replace: _next/next-server.js.nft.json
🔁 File replace: _next/prerender-manifest.js
🔁 File replace: _next/prerender-manifest.json
🔁 File replace: _next/server/middleware-build-manifest.js
🔁 File replace: _next/server/pages/_document.js
🔁 File replace: _next/server/pages/403.html
🔁 File replace: _next/server/pages/404.html
🔁 File replace: _next/server/pages/500.html
🔁 File replace: _next/server/pages/impresszum.html
🔁 File replace: _next/server/pages/index.html
🔁 File replace: _next/trace
🔁 File replace: package-lock.json
🔁 File replace: package.json
🔁 File replace: pages/_document.tsx
📁 Delete: _next/static/febuUMLM9VbdPJgDHOCse
⚖️  File content is the same, doing nothing: _next/export-marker.json
⚖️  [...] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<--- I dropped out irrelevant lines. There is no errors.
⚖️  File content is the same, doing nothing: tsconfig.json
----------------------------------------------------------------
Making changes to 28 files/folders to sync server state
Uploading: 830 B -- Deleting: 830 B -- Replacing: 9.18 MB
----------------------------------------------------------------
creating folder "_next/static/_RfaoSevEUUzn1m-yNWNm/"
uploading "_next/static/_RfaoSevEUUzn1m-yNWNm/_buildManifest.js"
uploading "_next/static/_RfaoSevEUUzn1m-yNWNm/_ssgManifest.js"
replacing "_next/BUILD_ID"
replacing "_next/build-manifest.json"
replacing "_next/cache/.tsbuildinfo"
replacing "_next/cache/config.json"
replacing "_next/cache/eslint/.cache_metchw"
replacing "_next/cache/next-server.js.nft.json"
replacing "_next/cache/webpack/client-production/0.pack"
replacing "_next/cache/webpack/client-production/index.pack"
replacing "_next/cache/webpack/server-production/0.pack"
replacing "_next/cache/webpack/server-production/index.pack"
replacing "_next/next-server.js.nft.json"
replacing "_next/prerender-manifest.js"
replacing "_next/prerender-manifest.json"
replacing "_next/server/middleware-build-manifest.js"
replacing "_next/server/pages/_document.js"
replacing "_next/server/pages/403.html"
replacing "_next/server/pages/404.html"
replacing "_next/server/pages/500.html"
replacing "_next/server/pages/impresszum.html"
replacing "_next/server/pages/index.html"
replacing "_next/trace"
replacing "package-lock.json"
replacing "package.json"
replacing "pages/_document.tsx"
removing folder "/_next/static/febuUMLM9VbdPJgDHOCse"

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

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

FTPError: 550 Can't change directory to /_next/static/febuUMLM9VbdPJgDHOCse: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5252:39)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5096:44)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:285:11)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 550
}
Error: FTPError: 550 Can't change directory to /_next/static/febuUMLM9VbdPJgDHOCse: No such file or directory

@ilias000
Copy link

ilias000 commented Dec 5, 2023

I had the same issue even though less than 6 months ago it was working perfectly. I tried everything and nothing worked. At the end the problem was with the permissions of the user I was using. After I gave the user all the permissions it worked perfectly.

@ms-daniel
Copy link

I had the same issue even though less than 6 months ago it was working perfectly. I tried everything and nothing worked. At the end the problem was with the permissions of the user I was using. After I gave the user all the permissions it worked perfectly.

absolute yes. thanks!

@Gordon-JeonghanKo
Copy link

I had the same issue even though less than 6 months ago it was working perfectly. I tried everything and nothing worked. At the end the problem was with the permissions of the user I was using. After I gave the user all the permissions it worked perfectly.

How can I gave a permission for the user??

@rezwansaki
Copy link

Thanks for this. Please try to do it for the Laravel project. :) When I push my project, '.env' file replace automatically again and again.

@paulopereira-tec
Copy link

I found a solution to the problem that might help. This apparently happens because it exceeds the open and inactive connection timeout. Same error in a C# library: https://www.chilkatsoft.com/p/p_462.asp

The solution I found was to increase the "timeout" to 2 minutes: timeout: 120000.

#446 (comment)

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

Successfully merging a pull request may close this issue.