GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.06k stars 407 forks source link

[Bug]: Cannot upload website via FTP, FTPS or SFTP #1417

Open Uzayer opened 3 months ago

Uzayer commented 3 months ago

Operating system

macOS 14.3.1 (23D60)

Publii version

0.45.1 (build 16608)

Post editor

None

Bug description

Using FTP services like Cyberduck works perfectly fine on the server. The same information was given to Publii, but the upload does not work. Test connection shows everything is fine but the sync website upload does not work.

Steps to reproduce

No response

Relevant log output

[Wed, 06 Mar 2024 12:58:09 GMT] ERR (2): Error: get: No such file /public_html/files.publii.json (Error: get: No such file /public_html/files.publii.json
    at SftpClient.fmtError (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2-sftp-client/src/index.js:87:22)
    at ReadStream.<anonymous> (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2-sftp-client/src/index.js:507:23)
    at Object.onceWrapper (node:events:632:26)
    at ReadStream.emit (node:events:517:28)
    at Object.cb (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/protocol/SFTP.js:3710:12)
    at 101 (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/protocol/SFTP.js:2858:11)
    at SFTP.push (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/protocol/SFTP.js:278:11)
    at CHANNEL_DATA (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/client.js:587:23)
    at 94 (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/protocol/handlers.misc.js:930:16)
    at Protocol.onPayload (/Applications/Publii.app/Contents/Resources/app.asar/node_modules/ssh2/lib/protocol/Protocol.js:2059:10)) [<- files.publii.json]
Founded 282 operations to do
[Wed, 06 Mar 2024 12:58:10 GMT] ERROR UPLOAD DIR: /public_html/tags
[Wed, 06 Mar 2024 12:58:10 GMT] Error: mkdir: _doMkdir: Permission denied /public_html
[Wed, 06 Mar 2024 12:58:10 GMT] ERROR UPLOAD DIR: /public_html/media
[Wed, 06 Mar 2024 12:58:10 GMT] Error: mkdir: _doMkdir: Permission denied /public_html
[Wed, 06 Mar 2024 12:58:11 GMT] ERROR UPLOAD DIR: /public_html/apply
[Wed, 06 Mar 2024 12:58:11 GMT] Error: mkdir: _doMkdir: Permission denied /public_html
internettips commented 3 months ago

@Uzayer

Hi, just for info / reference purposes ... I'm using the exact same operating system and Publii versions and builds, as you, plus my setup is SFTP (with key) and website upload, synch, etc., works just fine. My web host, in this instance, is SiteGround.com.

dziudek commented 3 months ago

Hi,

Most probably your "Path" option is configured wrongly - most probably you have to use the absolute path to the destination directory

internettips commented 3 months ago

@Uzayer @dziudek

When configuring my SFTP setup, when I followed my web host's instruction, I needed to change the Port to: 18765

Also, as @dziudek suggested, the precise Remote path was crucial. In my instance, it would be: /home/customer/www/your-domain-name.com/public_html/

Hope that helps.

jeckyl commented 3 months ago

FTP problem solved, but I don't know why.

meika commented 2 months ago

Just trying to understand what "precise remote path" might be ???

somedomain.com/public_html/ 
ftp.somedomain.com/public_html/

Publii Version: 0.42.1 (build 16233) on NixOS (so its the nixOS package and not very recent by the look)

filezilla works fine, but uploading the zip file will get more and more onerous.