Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Upload via SFTP not working

  • #5194
    Avatar photo[anonymous]

    My first day with Publii today, using v.0.37.3 (build 13870) beta.

    Trying to upload/sync via SFTP to a system in my local LAN (via IP address). ‘Test connection’ with credentials (either password or key file) works. But during ‘Sync your website’ the progress bar simply stops maybe 5 – 10% into the phase ‘Uploading website’.

    Tried both with an empty destination directory (freshly created) as well as after a successful manual upload of an initial set of files (using ‘Mountain Duck’/SFTP with the same set of credentials).

    deployment-errors.log is empty, deployment-process.log shows this:
    [Fri, 19 Feb 2021 16:55:18 GMT] <- files.publii.json
    [Fri, 19 Feb 2021 16:55:18 GMT] ERR (2): SyntaxError: Unexpected token in JSON at position 4096 (SyntaxError: Unexpected token in JSON at position 4096
    at JSON.parse (<anonymous>)
    at Deployment.compareFilesList (C:\Users\marcus\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\deploy\deployment.js:193:31)
    at C:\Users\marcus\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\deploy\sftp.js:140:33
    at processTicksAndRejections (internal/process/task_queues.js:93:5)) [<- files.publii.json]
    [Fri, 19 Feb 2021 16:55:18 GMT] ERR (3): SyntaxError: Unexpected token in JSON at position 4096 (SyntaxError: Unexpected token in JSON at position 4096
    at JSON.parse (<anonymous>)
    at Deployment.compareFilesList (C:\Users\marcus\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\deploy\deployment.js:193:31)
    at C:\Users\marcus\AppData\Local\Programs\Publii\resources\app.asar\back-end\modules\deploy\sftp.js:148:33
    at processTicksAndRejections (internal/process/task_queues.js:93:5)) [<- files.publii.json]

    #5205
    Avatar photo[anonymous]

    Hi,

    Please check you files.publii.json on your server – most probably it is partially uploaded and causes your error due invalid JSON structure.

    You can also validate your files.publii.json file using https://jsonlint.com/

    #5210
    Avatar photo[anonymous]

    Thanks for your answer. I had a look at the source json file in question and couldn’t find anything looking suspiciously at position 4096. So it could have been a partial/faulty transfer as might be indicated by the number being 2^12, which might be the transfer block size.

    Anyhow, due to some fiddling around with the site files myself and trying to move them to a different location I somehow managed to totally loose them and had to start anew (just an hour of work lost). With this new attempt the problem currently does not appear again so I do consider the topic closed.