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

Transient "451-Error during read from data connection" forces abort after max retries #322

Closed
yelper opened this issue Sep 24, 2022 · 5 comments · Fixed by #385
Closed

Comments

@yelper
Copy link

yelper commented Sep 24, 2022

Bug Description
It appears that the downstream dependency patrickjuchli/basic-ftp can abort a secure FTP connection too early when uploading "big" files around 45kB. The cause of this issue is the indirect dependency of this project on basic-ftp@4.6.6 instead of the fixed @^5 version.

A bug fix was introduced by #212 in patrickjuchli/basic-ftp. This bug reproduces consistently with my setup. I tried decreasing the timeout to no avail. Notice how the connection is closed before all data is transferred. My host is "knownhost" and I can provide a test FTPS account if requested.

Although your dependencies seem to pull in patrickjuchli/basic-ftp@^5.0.0 that contains this fix, the package-lock.json file in this repo still points to 4.6.6. The upstream projects' package-lock.json seems to be okay, so I think it's a deployment issue of your SamKirkland/FTP-Deploy package (the package registry SamKirkland/FTP-Deploy@1.2.2 notes ^4.6.2 for basic-ftp).

The dist.js code in this repro still uses the pre-fixed code of the original fix:

source.pipe(dataSocket).once("finish", () => {

Since this is a deployment issue, I think you need to re-issue a version for your upstream dependency and bump the version here too.

My Action Config

jobs:
  deploy_website:
    name: Deploy the darned thing
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        ref: new
    - name: ⚒ Jekyll build
      uses: gha-utilities/jekyll-build@v0.0.9
      with:
        destination: ./site/
    - name: 📂 Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.2
      with:
        server: ${{ secrets.FTP_HOST }}
        username: ${{ secrets.BETA_FTP_USERNAME }}
        password: ${{ secrets.BETA_FTP_PASSWORD }}
        protocol: ftps
        local-dir: ./site/
        server-dir: html/
        state-name: ../.ftp-deploy-sync-state.json
        timeout: 20000
        log-level: verbose

My Action Log

Sat, 24 Sep 2022 19:48:49 GMT Uploading to <ip-address>:54379 (TLSv1.3)
Sat, 24 Sep 2022 19:48:49 GMT upload progress for "assets/icon/apple-icon-60x60.png". Progress: 0 bytes of 357820 bytes
Sat, 24 Sep 2022 19:48:49 GMT upload progress for "assets/icon/apple-icon-60x60.png". Progress: 7621 bytes of 365441 bytes
Sat, 24 Sep 2022 19:48:49 GMT < 226-File successfully transferred
Sat, 24 Sep 2022 19:48:49 GMT
Sat, 24 Sep 2022 19:48:49 GMT < 226 0.000 seconds (measured here), 17.51 Mbytes per second
Sat, 24 Sep 2022 19:48:49 GMT
Sat, 24 Sep 2022 19:48:49 GMT   file uploaded
Sat, 24 Sep 2022 19:48:49 GMT uploading "assets/icon/apple-icon-72x72.png"
Sat, 24 Sep 2022 19:48:49 GMT > EPSV
Sat, 24 Sep 2022 19:48:49 GMT < 229 Extended Passive mode OK (|||51688|)
Sat, 24 Sep 2022 19:48:49 GMT
Sat, 24 Sep 2022 19:48:50 GMT > STOR assets/icon/apple-icon-72x72.png
Sat, 24 Sep 2022 19:48:50 GMT < 150 Accepted data connection
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT Uploading to <ip-address>:51688 (TLSv1.3)
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-72x72.png". Progress: 0 bytes of 365441 bytes
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-72x72.png". Progress: 9888 bytes of 375329 bytes
Sat, 24 Sep 2022 19:48:50 GMT < 226-File successfully transferred
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT < 226 0.000 seconds (measured here), 30.15 Mbytes per second
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT   file uploaded
Sat, 24 Sep 2022 19:48:50 GMT uploading "assets/icon/apple-icon-76x76.png"
Sat, 24 Sep 2022 19:48:50 GMT > EPSV
Sat, 24 Sep 2022 19:48:50 GMT < 229 Extended Passive mode OK (|||50323|)
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT > STOR assets/icon/apple-icon-76x76.png
Sat, 24 Sep 2022 19:48:50 GMT < 150 Accepted data connection
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT Uploading to <ip-address>:50323 (TLSv1.3)
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-76x76.png". Progress: 0 bytes of 375329 bytes
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-76x76.png". Progress: 10748 bytes of 386077 bytes
Sat, 24 Sep 2022 19:48:50 GMT < 226-File successfully transferred
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT < 226 0.000 seconds (measured here), 45.16 Mbytes per second
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT   file uploaded
Sat, 24 Sep 2022 19:48:50 GMT uploading "assets/icon/apple-icon-precomposed.png"
Sat, 24 Sep 2022 19:48:50 GMT > EPSV
Sat, 24 Sep 2022 19:48:50 GMT < 229 Extended Passive mode OK (|||49278|)
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT > STOR assets/icon/apple-icon-precomposed.png
Sat, 24 Sep 2022 19:48:50 GMT < 150 Accepted data connection
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT Uploading to <ip-address>:49278 (TLSv1.3)
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-precomposed.png". Progress: 0 bytes of 386077 bytes
Sat, 24 Sep 2022 19:48:50 GMT upload progress for "assets/icon/apple-icon-precomposed.png". Progress: 42570 bytes of 428647 bytes
Sat, 24 Sep 2022 19:48:50 GMT < 451-Error during read from data connection
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT < 451-Transfer aborted
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT < 451 0.122 seconds (measured here), 131.11 Kbytes per second
Sat, 24 Sep 2022 19:48:50 GMT
Sat, 24 Sep 2022 19:48:50 GMT 400 level error from server when performing action - retrying...
Sat, 24 Sep 2022 19:48:50 GMT FTPError: 451-Error during read from data connection
Sat, 24 Sep 2022 19:48:50 GMT 451-Transfer aborted
Sat, 24 Sep 2022 19:48:50 GMT 451 0.122 seconds (measured here), 131.11 Kbytes per second
Sat, 24 Sep 2022 19:48:50 GMT     at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.2/dist/index.js:5254:39)
Sat, 24 Sep 2022 19:48:50 GMT     at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.2/dist/index.js:5095:44)
Sat, 24 Sep 2022 19:48:50 GMT     at TLSSocket.emit (events.js:314:20)
Sat, 24 Sep 2022 19:48:50 GMT     at addChunk (_stream_readable.js:297:12)
Sat, 24 Sep 2022 19:48:50 GMT     at readableAddChunk (_stream_readable.js:268:11)
Sat, 24 Sep 2022 19:48:50 GMT     at TLSSocket.Readable.push (_stream_readable.js:213:10)
Sat, 24 Sep 2022 19:48:50 GMT     at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) {
Sat, 24 Sep 2022 19:48:50 GMT   code: 451
Sat, 24 Sep 2022 19:48:50 GMT }
Sat, 24 Sep 2022 19:48:50 GMT > EPSV
Sat, 24 Sep 2022 19:48:51 GMT < 229 Extended Passive mode OK (|||57438|)
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT > STOR assets/icon/apple-icon-precomposed.png
Sat, 24 Sep 2022 19:48:51 GMT < 150 Accepted data connection
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT Uploading to <ip-address>:57438 (TLSv1.3)
Sat, 24 Sep 2022 19:48:51 GMT upload progress for "assets/icon/apple-icon-precomposed.png". Progress: 0 bytes of 428647 bytes
Sat, 24 Sep 2022 19:48:51 GMT upload progress for "assets/icon/apple-icon-precomposed.png". Progress: 42570 bytes of 471217 bytes
Sat, 24 Sep 2022 19:48:51 GMT < 451-Error during read from data connection
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT < 451-Transfer aborted
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT < 451 0.121 seconds (measured here), 144.94 Kbytes per second
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT ----------------------------------------------------------------
Sat, 24 Sep 2022 19:48:51 GMT --------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
Sat, 24 Sep 2022 19:48:51 GMT ----------------------------------------------------------------
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT ----------------------------------------------------------------
Sat, 24 Sep 2022 19:48:51 GMT ----------------------  full error below  ----------------------
Sat, 24 Sep 2022 19:48:51 GMT ----------------------------------------------------------------
Sat, 24 Sep 2022 19:48:51 GMT
Sat, 24 Sep 2022 19:48:51 GMT FTPError: 451-Error during read from data connection
Sat, 24 Sep 2022 19:48:51 GMT 451-Transfer aborted
Sat, 24 Sep 2022 19:48:51 GMT 451 0.121 seconds (measured here), 144.94 Kbytes per second
Sat, 24 Sep 2022 19:48:51 GMT     at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.2/dist/index.js:5254:39)
Sat, 24 Sep 2022 19:48:51 GMT     at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.3.2/dist/index.js:5095:44)
Sat, 24 Sep 2022 19:48:51 GMT     at TLSSocket.emit (events.js:314:20)
Sat, 24 Sep 2022 19:48:51 GMT     at addChunk (_stream_readable.js:297:12)
Sat, 24 Sep 2022 19:48:51 GMT     at readableAddChunk (_stream_readable.js:268:11)
Sat, 24 Sep 2022 19:48:51 GMT     at TLSSocket.Readable.push (_stream_readable.js:213:10)
Sat, 24 Sep 2022 19:48:51 GMT     at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) {
Sat, 24 Sep 2022 19:48:51 GMT   code: 451
Sat, 24 Sep 2022 19:48:51 GMT }
Sat, 24 Sep 2022 19:48:51 GMT Error: FTPError: 451-Error during read from data connection
451-Transfer aborted
@shawnmjones
Copy link

shawnmjones commented Dec 23, 2022

I can confirm that I just ran into this as well. I ended up using sebastianpopp/ftp-action and that worked. I like SamKirkland/FTP-Deploy-Action because it has some nice features and useful output.

Edit: I listed the wrong GH repo for my current solution.

@hanassabio
Copy link

Is there a resolution for this issue? Having the same problem

@yelper
Copy link
Author

yelper commented Mar 4, 2023

I made a PR #380, you can use yelper/FTP-Deploy-Action@master in the meantime.

Here's my sample deploy file (I used chown to workaround issue in #146)

@SamKirkland
Copy link
Owner

See release v4.3.4

@yelper
Copy link
Author

yelper commented Mar 16, 2023

awesome, I confirmed in live use. Thanks again!!

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

Successfully merging a pull request may close this issue.

4 participants