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

Installation via snapcraft can't write to filesystem #31

Closed
jimafisk opened this issue May 27, 2020 · 6 comments
Closed

Installation via snapcraft can't write to filesystem #31

jimafisk opened this issue May 27, 2020 · 6 comments
Labels
bug Something isn't working high high priority

Comments

@jimafisk
Copy link
Member

Installing plenti manually by placing the binary at /usr/local/bin/plenti works on Ubuntu 20.04, however if instead you try using snap install plenti it appears that it can't write to the filesystem correctly. For example, running plenti new site test results in:

Unable to write file: open test/content/blog/_blueprint.json: no such file or directoryUnable to write file: open test/content/pages/about.json: no such file or directoryUnable to write file: open test/layout/components/template.svelte: no such file or directoryUnable to write file: open test/layout/content/404.svelte: no such file or directoryUnable to write file: open test/layout/global/head.svelte: no such file or directoryUnable to write file: open test/layout/scripts/load_component.svelte: no such file or directoryUnable to write file: open test/assets/favicon.svg: no such file or directoryUnable to write file: open test/assets/planarian.svg: no such file or directoryUnable to write file: open test/layout/scripts/sort_by_date.svelte: no such file or directoryUnable to write file: open test/content/blog/post2.json: no such file or directoryUnable to write file: open test/content/index.json: no such file or directoryUnable to write file: open test/layout/content/blog.svelte: no such file or directoryUnable to write file: open test/layout/content/index.svelte: no such file or directoryUnable to write file: open test/layout/global/footer.svelte: no such file or directoryUnable to write file: open test/layout/global/html.svelte: no such file or directoryUnable to write file: open test/content/blog/adding_pletiform.json: no such file or directoryUnable to write file: open test/content/blog/post1.json: no such file or directoryUnable to write file: open test/layout/global/nav.svelte: no such file or directoryUnable to write file: open test/content/pages/contact.json: no such file or directoryUnable to write file: open test/layout/content/pages.svelte: no such file or directoryUnable to write file: open test/layout/scripts/make_title.svelte: no such file or directoryUnable to write file: open test/plenti.json: no such file or directoryUnable to write file: open test/.gitignore: no such file or directoryUnable to write file: open test/content/pages/_blueprint.json: no such file or directoryUnable to write file: open test/layout/components/grid.svelte: no such file or directoryUnable to write file: open test/package.json: no such file or directoryCreated plenti site scaffolding in "test" folder
Installing NPM dependencies...
NPM install complete!

Note: If switching between installation methods, for example if you were to try to snap remove plenti then manually install you'll likely get an error like:

bash: /snap/bin/plenti: No such file or directory

To fix this you simply need to close out of your current terminal and reopen a new one.

@jimafisk jimafisk added the bug Something isn't working label May 27, 2020
@jimafisk
Copy link
Member Author

Looks like we need to set confinement to classic which "allows access to your system’s resources" per: https://snapcraft.io/docs/snap-confinement

Goreleaser appears to use strict confinement by default: https://goreleaser.com/customization/snapcraft/

@jimafisk
Copy link
Member Author

Classic confinement needs manual review, so the build errors with:

- (NEEDS REVIEW) confinement 'classic' not allowed. If your snap needs classic confinement to function, please make a request for this snap to use classic by creating a new topic in the forum using the 'store-requests' category and detail the technical reasons why classic is required.

@jimafisk
Copy link
Member Author

The store requests link in the manual review process mentioned above no longer seems to be the correct way to prompt review.

Last build automatically created a manual review request in the plenti project dashboard: https://dashboard.snapcraft.io/snaps/plenti/revisions/15/

@jimafisk
Copy link
Member Author

@jimafisk
Copy link
Member Author

Can continue using strict confinement, but needed to add plug to provide read / write access: https://forum.snapcraft.io/t/classic-confinement-request-for-plenti/17803/2?u=jimafisk

I had to click "reject review" at the bottom of the release 15 https://dashboard.snapcraft.io/snaps/plenti/revisions/15/. Then https://dashboard.snapcraft.io/snaps/plenti/revisions/17/ and https://dashboard.snapcraft.io/snaps/plenti/revisions/18/ had a statuses of "ready to release" so at the bottom of the page I clicked the green "Release" button for each. After that releases started working automatically when Github actions would run.

I also needed to add "network-bind" plug in order to allow local webserver to work. Previously was getting the following error:

listen tcp :3000: listen: operation not permitted

The last remain issue seems to be that the snap can't execute external scripts. This is needed in order to run npm install when creating a new site and to run the ejectable build.js which runs on every build.

jimafisk added a commit that referenced this issue May 28, 2020
@jimafisk jimafisk added the high high priority label Jul 12, 2020
@jimafisk
Copy link
Member Author

NodeJS and NPM aren't required in v0.2.0 and later version, so we don't need to implement a “parts” declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high high priority
Projects
None yet
Development

No branches or pull requests

1 participant