FTP-Deploy-Action icon indicating copy to clipboard operation
FTP-Deploy-Action copied to clipboard

FTPError: 553 Can't open that file: No such file or directory

Open marcos-queiroz opened this issue 3 years ago • 10 comments

Bug Description I'm getting error 553 when updating the repository.

In the first synchronization the action worked perfectly, but when updating any file the second action returns the error.

My Action Config

on: 
  push: 
    branches:
      - main
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2
      
    - name: 🚚 Install Composer Dependencies SITE
      working-directory: ./
      run: composer install --prefer-dist
    
    - name: 🚚 Install Composer Dependencies ADM
      working-directory: ./public/adm
      run: composer install --prefer-dist
            
    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ${{ secrets.ftp_host}}
        username: ${{ secrets.ftp_user }}
        password: ${{ secrets.ftp_password }}
        exclude: |
          .git/**
          .git**
          .git*/**
          **/.git*
          **/.git*/**
          **/node_modules/**
          fileToExclude.txt

My Action Log

   Making changes to 2346 files/folders to sync server state
Uploading: 0 B -- Deleting: 16.2 MB -- Replacing: 434 kB
----------------------------------------------------------------
replacing "app/Config/App.php"
replacing "app/Config/Constants.php"
replacing "app/Views/client/templates/mdb/components/navbar.html"
replacing "app/Views/client/templates/mdb/components/post.html"
replacing "public/adm/composer.lock"
replacing "public/adm/vendor/autoload.php"

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

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

FTPError: 553 Can't open that file: 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: 553
}
Error: FTPError: 553 Can't open that file: No such file or directory

marcos-queiroz avatar Jan 26 '22 23:01 marcos-queiroz

I experience the same error, please any solution?

Abdulkereem avatar Feb 04 '22 01:02 Abdulkereem

Same issue, my not-so-ideal solution was to delete the .ftp-deploy-sync-state.json off the FTP server. The downside is uploading everything fresh again.

mikedelgaudio avatar Feb 08 '22 01:02 mikedelgaudio

If the push to ftp you did prior involved removing files/paths, it seems that the next push to ftp you execute will generate this error. Git seems to require placholders to maintain folder structure, once those placeholders are gone, so are their parent folders so long as they were the only item in it. The script doesn't know how to handle this behavior as it retains the full path info that git automatically removes.

aploessl avatar Feb 09 '22 21:02 aploessl

I have a similar issue:

removing "vendor/spatie/laravel-ignition/src/Solutions/SuggestLivewireMethodNameSolution.php"
removing "vendor/spatie/laravel-ignition/src/Solutions/SuggestLivewirePropertyNameSolution.php"
removing "vendor/spatie/laravel-ignition/src/Solutions/SuggestUsingCorrectDbNameSolution.php"
removing "vendor/spatie/laravel-ignition/src/Solutions/UseDefaultValetDbCredentialsSolution.php"
removing "vendor/spatie/laravel-ignition/src/Support/Composer/Composer.php"
removing "vendor/spatie/laravel-ignition/src/Support/Composer/ComposerClassMap.php"
removing "vendor/spatie/laravel-ignition/src/Support/Composer/FakeComposer.php"
removing "vendor/spatie/laravel-ignition/src/Support/FlareLogHandler.php"
removing "vendor/spatie/laravel-ignition/src/Support/LaravelDocumentationLinkFinder.php"
removing "vendor/spatie/laravel-ignition/src/Support/LaravelVersion.php"
removing "vendor/spatie/laravel-ignition/src/Support/LivewireComponentParser.php"
removing "vendor/spatie/laravel-ignition/src/Support/SentReports.php"
removing "vendor/spatie/laravel-ignition/src/Support/StringComparator.php"
removing "vendor/spatie/laravel-ignition/src/Views/BladeSourceMapCompiler.php"
removing "vendor/spatie/laravel-ignition/src/Views/ViewExceptionMapper.php"
removing folder "vendor/spatie/"

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

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

FTPError: 550 Can't change directory to spatie/: 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 spatie/: No such file or directory

Solution was also to delete .ftp-deploy-sync-state.json, but then it takes almost 6h to upload everything again which is a tad bit too long...

Bird87ZA avatar Feb 15 '22 19:02 Bird87ZA

Se o push para o ftp que você fez anteriormente envolveu a remoção de arquivos/caminhos, parece que o próximo push para o ftp que você executar gerará esse erro. O Git parece exigir que os placeholders mantenham a estrutura de pastas, uma vez que esses placeholders desaparecem, assim como suas pastas pai, desde que sejam o único item nela. O script não sabe como lidar com esse comportamento, pois retém as informações completas do caminho que o git remove automaticamente.

that seems to be the problem.

If you remove a directory on the host or file this error occurs.

I deleted the entire directory and the new puhs worked fine.

marcos-queiroz avatar Mar 03 '22 22:03 marcos-queiroz

I did the same and it worked for me too.

bolenge avatar Mar 29 '22 10:03 bolenge

Just change the file permissions of .ftp-deploy-sync-state.json to 744.

by default website files has 644 permissions (no execution). This way you'll avoid uploading all (this happens if you delete that control file as mentioned above).

You can make that change transitory with an automated activity prior to and post-action execution to avoid any security concerns.

manuelpazprad avatar May 14 '22 14:05 manuelpazprad

I had same problem. checkout Action job's log. maybe you deleted some directory or file on server.

AliSafaei1990 avatar May 26 '22 09:05 AliSafaei1990

Happened to me as well, though I manually removed folders that are written within the .ftp-deploy-sync-state.json file. My fix was simple, I removed the missing folder from the file data. Maybe a better solution to this will be to catch the error and skip the missing or non-accessible folder like you do for files

A caught file example:

removing "precache-manifest.6849d4d55a08706cec74d7a62498abe8.js"
File not found or you don't have access to the file - skipping...

idanavin avatar Jun 16 '22 23:06 idanavin

Hi, any update on this? I'm getting the same issue.

bartoszkrawczyk2 avatar Jul 29 '22 22:07 bartoszkrawczyk2

same issue.

rkritskiy avatar Aug 12 '22 23:08 rkritskiy

Are you on the newest version? Because for me this was fixed months ago.

JulianGro avatar Aug 13 '22 03:08 JulianGro

For me it worked perfectly after updating to the latest version.

My new action config

on: 
  push: 
    branches:
      - main
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2
      
    - name: 🚚 Install Composer Dependencies SITE
      working-directory: ./
      run: composer install --prefer-dist
    
    - name: 🚚 Install Composer Dependencies ADM
      working-directory: ./public/adm
      run: composer install --prefer-dist
            
    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ${{ secrets.ftp_host}}
        username: ${{ secrets.ftp_user }}
        password: ${{ secrets.ftp_password }}
        exclude: |
          .git/**
          .git**
          .git*/**
          **/.git*
          **/.git*/**
          **/node_modules/**
          fileToExclude.txt

marcos-queiroz avatar Aug 30 '22 17:08 marcos-queiroz

Hi,

I got the same error only when I deploy straight to public_html folder in my webhosting. When I put it inside a folder (ie: public_html/mywebsite) there is no problem.

Is there any way or config that allows me to do that.

thank you

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

FTPError: 553 Can't open that file: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.3/dist/index.js:5254:39)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.3/dist/index.js:5095:[44](https://github.com/sandhikagalih/kedai-kopi-kenangan-senja/actions/runs/3826356173/jobs/6510075914#step:3:45))
    at Socket.emit (node:events:390: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:199:23) {
  code: 5[53](https://github.com/sandhikagalih/kedai-kopi-kenangan-senja/actions/runs/3826356173/jobs/6510075914#step:3:54)
}
Error: FTPError: 553 Can't open that file: No such file or directory

sandhikagalih avatar Jan 03 '23 02:01 sandhikagalih

I fixed the issue by deleting file .ftp-deploy-sync-state.json , however, be aware that all the files will be resynced again after the push.

zakasmi avatar Feb 24 '23 20:02 zakasmi

Hi,

I got the same error only when I deploy straight to public_html folder in my webhosting. When I put it inside a folder (ie: public_html/mywebsite) there is no problem.

Is there any way or config that allows me to do that.

thank you

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

FTPError: 553 Can't open that file: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.3/dist/index.js:5254:39)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.3/dist/index.js:5095:[44](https://github.com/sandhikagalih/kedai-kopi-kenangan-senja/actions/runs/3826356173/jobs/6510075914#step:3:45))
    at Socket.emit (node:events:390: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:199:23) {
  code: 5[53](https://github.com/sandhikagalih/kedai-kopi-kenangan-senja/actions/runs/3826356173/jobs/6510075914#step:3:54)
}
Error: FTPError: 553 Can't open that file: No such file or directory

Mantap Pak Dika

suryakumara avatar May 13 '23 11:05 suryakumara