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

`550 .ftp-deploy-sync-state.json: No such file or directory`

Open overheadhunter opened this issue 2 years ago β€’ 8 comments

Bug Description I want to upload files. Not sync them. Just upload. Nothing fancy. Upload succeeds, however the action still fails due to 550 .ftp-deploy-sync-state.json: No such file or directory.

My Action Config

on: push
jobs:
  // ...
  allowlist:
    steps:
      - name: Upload to Kaspersky
        uses: SamKirkland/[email protected]
        with:
          protocol: ftps
          server: allowlist.kaspersky-labs.com
          port: 990
          username: ${{ secrets.ALLOWLIST_KASPERSKY_USERNAME }}
          password: ${{ secrets.ALLOWLIST_KASPERSKY_PASSWORD }}
          local-dir: files/

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
----------------------------------------------------------------
No file exists on the server "./.ftp-deploy-sync-state.json" - this must be your first publish! πŸŽ‰
The first publish will take a while... but once the initial sync is done only differences are published!
If you get this message and its NOT your first publish, something is wrong.
----------------------------------------------------------------
Local Files:	2
Server Files:	0
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
πŸ“„ Upload: file1
πŸ“„ Upload: file2
----------------------------------------------------------------
Making changes to 2 files/folders to sync server state
Uploading: 1[12](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:13) MB -- Deleting: 0 B -- Replacing: 0 B
----------------------------------------------------------------
uploading "file1"
uploading "file2"
----------------------------------------------------------------
πŸŽ‰ Sync complete. Saving current server state to "./.ftp-deploy-sync-state.json"

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

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

FTPError: 550 .ftp-deploy-sync-state.json: No such file or directory
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.0/dist/index.js:4774:39)
    at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.0/dist/index.js:4615:44)
    at TLSSocket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at TLSSocket.Readable.push (_stream_readable.js:2[13](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:14):10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:[18](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:19)8:[23](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:24)) {
  code: 5[50](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:51)
}
Error: FTPError: [55](https://github.com/foo/bar/actions/runs/23/jobs/42#step:5:56)0 .ftp-deploy-sync-state.json: No such file or directory

overheadhunter avatar Oct 07 '22 06:10 overheadhunter

I have exactly the same problem.

CAnorbo avatar Oct 11 '22 08:10 CAnorbo

A similar problem

WEBzaytsev avatar Nov 28 '22 10:11 WEBzaytsev

me too

abdellaui avatar Jan 20 '23 04:01 abdellaui

It seems that if there are very few files to sync then the server canΒ΄t respond in time.. Maybe the solution is only to sync when you have several files ;-)

jamtuba avatar Mar 01 '23 16:03 jamtuba

I'm having the same problem. Has anybody found any solution to it yet?

iammursal avatar Mar 09 '23 13:03 iammursal

I'm having the same problem. Has anybody found any solution to it yet?

I copied all the files manually to the server and then let this script do the changes, which help for me.

CAnorbo avatar Mar 09 '23 14:03 CAnorbo

@CAnorbo but that would eliminate the whole purpose of automation. Instead what I did was set " dangerous-clean-slate" to true and it worked. Thought this made deployment extremely slow

iammursal avatar Mar 11 '23 15:03 iammursal

As mentioned by @olivergrabinski in #254 , the solution is simple:

To solve the problem on my end, it was sufficient to run mkdir $folderName just after the checkout step (where $folderName is the name of the folder I wanted to upload). This ensured the folder already existed and had the right ownership requirements before it was created by the other process.

In my case, I was able to add the following step in my action before any of the actions that reference the folder:

  - name: Make release folder
    run: mkdir ./release/

Didel avatar Jun 25 '23 12:06 Didel