Sync error when you delete a folder with subfolders
See original GitHub issueBug 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:
- Created 2 years ago
- Reactions:1
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My team is having same issue
@timocouckuyt thanks, it works with latest version