Publii icon indicating copy to clipboard operation
Publii copied to clipboard

[Bug]: Throwing file errors on Apple Silicon

Open momorgan opened this issue 2 years ago • 5 comments

Operating system

macOS Monterey 12.6 / Apple M1 Pro

Publii version

0.41.1 (build 15919) and also tried 0.40.3 (build 15745)

Post editor

None

Bug description

App throws an error on accepting license terms:

Uncaught Exception: Error: ENOENT: no such file or directory, open '/Users/USERNAME/Documents/Publii/config/app-config.json' at Object.openSync (node:fs:585:3) at Object.func [as openSync] (node:electron/js2c/asar_bundle:5:1812) at Object.writeFileSync (node:fs:2157:35) at IpcMainImpl. (/Applications/Publii.app/Contents/Resources/app.asar/back-end/events/app.js:27:16) at IpcMainImpl.emit (node:events:526:28) at IpcMainImpl.emit (node:domain:475:12) at EventEmitter. (node:electron/js2c/browser_init:161:11014) at EventEmitter.emit (node:events:526:28) at EventEmitter.emit (node:domain:475:12)

If you quit and restart the app, it's possible to accept terms, but then adding a site throws a different error:

Uncaught Exception: Error: ENOENT: no such file or directory, mkdir '/Users/USERNAME/Documents/Publii/sites/x' at Object.mkdirSync (node:fs:1336:3) at Site.createDirectories (/Applications/Publii.app/Contents/Resources/app.asar/back-end/site.js:68:12) at Site.create (/Applications/Publii.app/Contents/Resources/app.asar/back-end/site.js:46:18) at IpcMainImpl. (/Applications/Publii.app/Contents/Resources/app.asar/back-end/events/site.js:393:31) at IpcMainImpl.emit (node:events:526:28) at IpcMainImpl.emit (node:domain:475:12) at EventEmitter. (node:electron/js2c/browser_init:161:11014) at EventEmitter.emit (node:events:526:28) at EventEmitter.emit (node:domain:475:12)

If you then quit and restart, accept terms, go to app setting, change sites location and hit save, it throws another error:

Uncaught Exception: Error: ENOENT: no such file or directory, open '/Users/USERNAME/Documents/Publii/config/app-config.json' at Object.openSync (node:fs:585:3) at Object.func [as openSync] (node:electron/js2c/asar_bundle:5:1812) at Object.writeFileSync (node:fs:2157:35) at IpcMainImpl. (/Applications/Publii.app/Contents/Resources/app.asar/back-end/events/app.js:88:16) at IpcMainImpl.emit (node:events:526:28) at IpcMainImpl.emit (node:domain:475:12) at EventEmitter. (node:electron/js2c/browser_init:161:11014) at EventEmitter.emit (node:events:526:28) at EventEmitter.emit (node:domain:475:12)

I've checked the file system and all the files it says it can't find are there.

Steps to reproduce

  1. Install and launch
  2. Click Accept

--

  1. Install and launch
  2. Click Accept (if applicable)
  3. Enter website name and author name
  4. Click Create website

--

  1. Install and launch
  2. Click Accept
  3. Click App settings
  4. Change Sites location
  5. Click Save

Relevant log output

No response

momorgan avatar Dec 08 '22 12:12 momorgan

Hi,

Did you give Publii access to the files on your computer? It looks like Publii is unable to access your filesystem.

dziudek avatar Dec 10 '22 17:12 dziudek

Publii is listed under Full Disk Access

Screenshot 2022-12-11 at 13 07 21

momorgan avatar Dec 11 '22 13:12 momorgan

@momorgan - I see two possible reasons - could you tell me if:

  1. the username contains some special character or spaces?
  2. your documents are synced to some cloud service like Google Drive?

dziudek avatar Dec 13 '22 20:12 dziudek

Hi,

  1. No, just letters and a dot
  2. No, nothing like that

Thanks

momorgan avatar Dec 13 '22 22:12 momorgan

@momorgan - unfortunately at this moment I have no idea what can be a reason of your issues - I have spot one bug during saving theme settings, but it is not related to your errors :/

dziudek avatar Dec 16 '22 23:12 dziudek