question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sync error when you delete a folder with subfolders

See original GitHub issue

Bug Description This is my folders structure

πŸ“ www
     πŸ“ app
         βž• file1, file2, ..., fileN
     πŸ“ assets
          πŸ“ excel
              βž• file1, file2, ..., fileN
          πŸ“ pdf
              βž• file1, file2, ..., fileN
         βž• file1, file2, ..., fileN

If I remove the assets folder and all of its children elements (folders and files) the deploy process will be:

  • List all folders and files to delete (Sorted by path name), DiffResult.delete will have the next list:
πŸ“ www/assets
βž• www/assets/file1
βž• www/assets/file2
βž• www/assets/...
βž• www/assets/fileN
πŸ“ www/assets/excel
βž• www/assets/excel/file1
βž• www/assets/excel/file2
βž• www/assets/excel/...
βž• www/assets/excel/fileN
πŸ“ www/assets/pdf
βž• www/assets/pdf/file1
βž• www/assets/pdf/file2
βž• www/assets/pdf/...
βž• www/assets/pdf/fileN
  • Next the delete process will be:
    • Delete files first. No problem with this.
    • Delete folders next. And here is the problem, because the process will try to delete the parent folder πŸ“ www/assets before delete the children folders πŸ“ www/assets/excel and πŸ“ www/assets/pdf and the process have

My Action Config Any normal default config

My Action Log

removing "www/assets/file1"
removing "www/assets/file2"
removing "www/assets/fileN"
removing "www/assets/excel/file1"
removing "www/assets/excel/file2"
removing "www/assets/excel/fileN"
removing "www/assets/pdf/file1"
removing "www/assets/pdf/file2"
removing "www/assets/pdf/fileN"
removing folder "www/assets/"

----------------------------------------------------------------
--------------  πŸ”₯πŸ”₯πŸ”₯ an error occurred  πŸ”₯πŸ”₯πŸ”₯  --------------
----------------------------------------------------------------

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

FTPError: 550 Can't change directory to assets/: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.2.0/dist/index.js:4744:39)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.2.0/dist/index.js:4585: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 Carbon/: No such file or directory

I guess the solution could be in the here in HashDiff.getDiffs sorting the files backwards, because you will have the list in this way:

βž• www/assets/pdf/fileN
βž• www/assets/pdf/...
βž• www/assets/pdf/file2
βž• www/assets/pdf/file1
πŸ“ www/assets/pdf
βž• www/assets/excel/fileN
βž• www/assets/excel/...
βž• www/assets/excel/file2
βž• www/assets/excel/file1
πŸ“ www/assets/excel
βž• www/assets/fileN
βž• www/assets/...
βž• www/assets/file2
βž• www/assets/file1
πŸ“ www/assets

and the children folders delete will be first.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
pepkolajkcommented, Mar 9, 2022

My team is having same issue

0reactions
JaviRpocommented, Apr 1, 2022

@timocouckuyt thanks, it works with latest version

Read more comments on GitHub >

github_iconTop Results From Across the Web

You have to delete all the items in this folder before you can ...
Just hit this issue and found the quickest way to delete is to sync the document library to OneDrive on your local computer,...
Read more >
Fix "You have to delete all the items in this folder before you ...
Problem: When trying to delete a folder with sub-folders and files, I got an error message β€œYou have to delete all the items...
Read more >
How to: Fix "You have to delete all the items in this folder ...
The Fix. There are two workarounds, 1 one is manually dive into the folders, till we open the last and innermost folder, then...
Read more >
Can't Delete a OneDrive File or Folder? Here's What to Do
1. Make Sure the File Is Closed First Β· 2. Check Your File and Folder's Permissions Β· 3. Try Deleting the File From...
Read more >
Delete folder with subfolder and files from SharePoint Online ...
You may see recommendations to use the SharePoint "Sync" feature. Don't. This is a real overkill for just deleting a single folder,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found