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.34k stars 419 forks source link

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

Open Uzayer opened 8 months ago

Uzayer commented 8 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 8 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 8 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 8 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 8 months ago

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

meika commented 7 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.

keomabrun commented 2 months ago

Hi :wave:

I have a similar issue.

image

I am using Publiii version 0.46.1 (build 16918) on MintOS. Filezilla works fine too.

I have tried relative and absolute paths, with and without slashes.

I don't see error message in the CLI though, so I'm not sure this is exactly the same error.

meika commented 2 months ago

Keep trying various file pathway variations, mine ended up being the simplest one, not the complex longer versions somedomain.com not somedomain.com/username/public/subdomain/home/.... (or whatever you've got)(serving suggestions are exaggerated for effect)

apparently it varies a lot by hosting provider and whatever guesswork is in the middle by Publii

when it finally worked I was shocked, there is no clear help on this unfortunately, even contacting my friendly hosting provider was not particular helpful, but start with the simplest and see how you go

marcpley commented 2 months ago

Hello. I work with keomabrun on the same issue. I tryed various file pathway variations. Sometime Publii say the connection is successful, sometime it say that the connection is successful but it is unable to store files. Both case with the same parameters ! After that, in any cases, the "Save settings" button is active but do nothing, so I cannot jump to site files uploading step.