Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Error: EACCES: permission denied, open './_site/.ftp-deploy-sync-state.json' #254

Open
ukutaht opened this issue Jan 14, 2022 · 4 comments

Comments

@ukutaht
Copy link

ukutaht commented Jan 14, 2022

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/FTP-Deploy-Action@4.2.0
      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 #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?

@TheoGimenez7
Copy link

I have the same Issue, I try to deploy an WebGL Unity build to an FTP server and same error

@artursopelnik
Copy link

+1

1 similar comment
@ErcinDedeoglu
Copy link

+1

@olivergrabinski
Copy link

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.

kumak1 added a commit to kumak1/webgl-build-exam that referenced this issue Jul 16, 2023
.ftp-deploy-sync-state.json を作成できないので、あらかじめFTPの転送元ディレクトリを作成しておく
SamKirkland/FTP-Deploy-Action#254 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants