FTP-Deploy-Action
FTP-Deploy-Action copied to clipboard
Error: Error: EACCES: permission denied, open './_site/.ftp-deploy-sync-state.json'
Bug Description
I am trying to upload a jekyll site to BunnyCDN over FTP. I started with the following configuration:
- name: 📂 Sync files
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./_site/
Full configuration here
This configuration does not successfully upload the files, instead it throws the following error:
Error: Error: EACCES: permission denied, open './_site/.ftp-deploy-sync-state.json'
Full build log here
Workaround
I tried using the workaround mentioned in https://github.com/SamKirkland/FTP-Deploy-Action/issues/146 that adds the following configuration:
state-name: ../.ftp-deploy-sync-state.json
Unfortunately this doesn't work for me either. The build gets much further but times out at the end when it tries to save the state file:
Error: Timeout (control socket)
at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.2.0/dist/index.js:4778:58)
at Object.onceWrapper (events.js:299:28)
at Socket.emit (events.js:210:5)
at Socket._onTimeout (net.js:469:8)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
Error: Error: Timeout (control socket)
Full build log [here](https://github.com/plausible/website/runs/4813302224?check_suite_focus=true0 I can confirm this is not an isolated failure, the timeout happens predictably every time.
Any ideas how to fix this?
I have the same Issue, I try to deploy an WebGL Unity build to an FTP server and same error
+1
+1
I suppose this is not really an FTP-Deploy-Action issue. The action needs to be able to write the .ftp-deploy-sync-state.json
inside the folder you want to upload; and the error indicates it does not have the correct ownership on that folder to do that.
In my case, the folder did not even exist in my repo: it was created in the Action in a previous step. That step was running a docker container, and the folder was created in a volume mounted to that container. I ran ls -hal .
before my FTP-Deploy-Action step, and sure enough, anything that was created via the docker container required root
privilege, whereas anything that was checked out from the repo was accessible to the runner
user.
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.
Each case might be a little different, but in the end it is about ensuring that the runner
user can write files inside the folder you want to upload.