SamKirkland / FTP-Deploy-Action

Deploys a GitHub project to a FTP server using GitHub actions
MIT License
3.81k stars 372 forks source link

Deleting folder throws an error #483

Open LucaBlackDragon opened 1 week ago

LucaBlackDragon commented 1 week ago

Bug Description During deploy, if the action tries to delete a folder that, for whatever reason, no longer exists on the server, it throws an error. I think that in this - and only this - specific case it should instead log a warning and go on.

EDIT: I'm also wondering if the error is due to the fact that the folder path starts with /, while all single files paths start without it, i.e.:

...  
📄 Delete: _next/static/chunks/main-4008b7bc3b992c03.js    
📁 Delete: _next/data/37sYNwt2oKohzL5dgd1TZ    
...
removing "_next/static/chunks/main-4008b7bc3b992c03.js"  ← this works
removing folder "/_next/data/37sYNwt2oKohzL5dgd1TZ"      ← a starting / has appeared, and this fails
...

My Action Config

      - name: FTP Deploy
        uses: SamKirkland/FTP-Deploy-Action@v4.3.5
        with:
          server: ${{ inputs.ftpServer }}
          username: ${{ inputs.ftpUsername }}
          password: ${{ secrets.FTP_PASSWORD }}
          port: ${{ inputs.ftpServerPort }}
          protocol: ftps
          local-dir: ${{ inputs.sourcePath }}
          server-dir: ./
          state-name: ./last_github_upload.txt
          dangerous-clean-slate: false
          exclude: |
            **/.git*
            **/.git*/**
            **/node_modules/**
            ${{ inputs.excludePaths }}
          log-level: standard
          timeout: ${{ inputs.ftpTimeout }}

My Action Log

----------------------------------------------------------------
🚀 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 📅 Sunday, October 6, [20](https://github.com/<...omissis...>)24 at 7:45 AM
----------------------------------------------------------------
Local Files:    37
Server Files:   37
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
📁 Create: _next/data/lRgS5oHPf3DHC5JfXQdWT
📁 Create: _next/static/lRgS5oHPf3DHC5JfXQdWT
📄 Upload: _next/data/lRgS5oHPf3DHC5JfXQdWT/index.json
📄 Upload: _next/static/chunks/973-d10f2acaa84bd773.js
📄 Upload: _next/static/chunks/main-a8d1d7f367b9d912.js
📄 Upload: _next/static/lRgS5oHPf3DHC5JfXQdWT/_buildManifest.js
📄 Upload: _next/static/lRgS5oHPf3DHC5JfXQdWT/_ssgManifest.js
🔁 File replace: 404.html
🔁 File replace: index.html
📄 Delete: _next/static/chunks/973-34abb649f54c1b45.js    
📄 Delete: _next/static/chunks/main-4008b7bc3b992c03.js    
📁 Delete: _next/data/37sYNwt2oKohzL5dgd1TZ    
📁 Delete: _next/static/37sYNwt2oKohzL5dgd1TZ    
⚖️  File content is the same, doing nothing: _next/static/chunks/framework-64ad27b[21](https://github.com/<...omissis...>)261a9ce.js
⚖️  File content is the same, doing nothing: _next/static/chunks/pages/_app-976c8a30b39334b8.js
⚖️  File content is the same, doing nothing: _next/static/chunks/pages/_error-7a92967bea80186d.js
⚖️  File content is the same, doing nothing: _next/static/chunks/pages/index-f049e8702852d075.js
⚖️  File content is the same, doing nothing: _next/static/chunks/polyfills-4[23](https://github.com/<...omissis...>)72ed130431b0a.js
⚖️  File content is the same, doing nothing: _next/static/chunks/webpack-527576ff117bb29f.js
⚖️  File content is the same, doing nothing: _next/static/css/c1c763bb[25](https://github.com/<...omissis...>)6fdf4f.css
⚖️  File content is the same, doing nothing: _next/static/media/03407990841cab7a-s.p.woff2
⚖️  File content is the same, doing nothing: _next/static/media/968c529aef8f703d-s.p.woff2
⚖️  File content is the same, doing nothing: _next/static/media/bn_square_360.66256f87.png
⚖️  File content is the same, doing nothing: acm.pdf
⚖️  File content is the same, doing nothing: biblio_nardi.pdf
⚖️  File content is the same, doing nothing: BingSiteAuth.xml
⚖️  File content is the same, doing nothing: bn_square_360.png
⚖️  File content is the same, doing nothing: bn_square_800.png
⚖️  File content is the same, doing nothing: bn_square.png
⚖️  File content is the same, doing nothing: cv_nardi.pdf
⚖️  File content is the same, doing nothing: favicon.ico
⚖️  File content is the same, doing nothing: nardi_firenze_2023.pdf
⚖️  File content is the same, doing nothing: poi.svg
⚖️  File content is the same, doing nothing: vercel.svg
----------------------------------------------------------------
Making changes to 13 files/folders to sync server state
Uploading: 140 kB -- Deleting: 140 kB -- Replacing: 13.3 kB
----------------------------------------------------------------
creating folder "_next/data/lRgS5oHPf3DHC5JfXQdWT/"
creating folder "_next/static/lRgS5oHPf3DHC5JfXQdWT/"
uploading "_next/data/lRgS5oHPf3DHC5JfXQdWT/index.json"
uploading "_next/static/chunks/973-d10f2acaa84bd773.js"
uploading "_next/static/chunks/main-a8d1d7f367b9d912.js"
uploading "_next/static/lRgS5oHPf3DHC5JfXQdWT/_buildManifest.js"
uploading "_next/static/lRgS5oHPf3DHC5JfXQdWT/_ssgManifest.js"
replacing "404.html"
replacing "index.html"
removing "_next/static/chunks/973-34abb649f54c1b45.js"
removing "_next/static/chunks/main-4008b7bc3b992c03.js"
removing folder "/_next/data/37sYNwt2oKohzL5dgd1TZ"

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

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

FTPError: 550 /_next/data/37sYNwt2oKohzL5dgd1TZ: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5[26](https://github.com/<...omissis...>)3:39)
    at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5107:44)
    at TLSSocket.emit (node:events:519:[28](https://github.com/<...omissis...>))
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23) {
  code: 550
}
tasza commented 3 days ago

I am experiencing the same issue :(