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

Taking Bartholomew for a spin => memfd error #11

Closed
1 of 3 tasks
freedaun opened this issue Feb 7, 2023 · 7 comments
Closed
1 of 3 tasks

Taking Bartholomew for a spin => memfd error #11

freedaun opened this issue Feb 7, 2023 · 7 comments

Comments

@freedaun
Copy link

freedaun commented Feb 7, 2023

Bartholomew site doesn't start (following the quickstart guide)

I'm following https://developer.fermyon.com/bartholomew/quickstart and at https://developer.fermyon.com/bartholomew/quickstart#spin-up-your-site it doesn't work. See the error message below. Otherwise it was very smooth sailing, impressive!

Frequency of the bug
Please check one:

  • Consistent repro
  • Intermittent repro
  • No repro

Set-up information
spin 0.8.0 (7086236 2023-01-31)

To Reproduce
Steps to reproduce the behavior:

user@NB057:/mnt/c/WINDOWS/system32/cloud-start/spinsite$ spin up --follow-all
    Preparing Wasm modules is taking a few seconds...
    
    Serving http://127.0.0.1:3000
    Available Routes:
      bartholomew: http://127.0.0.1:3000 (wildcard)
      fileserver: http://127.0.0.1:3000/static (wildcard)
    2023-02-07T19:36:04.361567Z ERROR spin_http: Error processing request: app "bartholomew-template" component "bartholomew" instantiation failed

Caused by:
    Insufficient resources: cannot create a memfd

The error message appears after following either link in the message.

Expected behavior

"When you navigate to http://localhost:3000, you should see the website running". No, instead the error above is generated.

Additional context
This is Ubuntu 20.04 running on WSL2 on W10.

@itowlson
Copy link

itowlson commented Feb 8, 2023

Hi @freedaun, thanks for letting us know and sorry you're running into this. I just tried the same thing (also on WSL Win10, but Ubuntu 22.04) and it worked correctly for me. I noticed your site was hosted on a Windows mount. When I try it this way, I do get an error, albeit a different one:

/mnt/d/Code Experiments/bart-memfd-repro-test [main|✔]
13:46 $ spin up --follow-all
Serving http://127.0.0.1:3000
Available Routes:
  bartholomew: http://127.0.0.1:3000 (wildcard)
  fileserver: http://127.0.0.1:3000/static (wildcard)
Cannot read file: Is a directory (os error 31)

Would it be possible for you to try checking out your site somewhere in the Ubuntu filesystem and trying from there please? Thanks!

@freedaun
Copy link
Author

freedaun commented Feb 9, 2023

Yes, sorry for that omission, and thanks for getting back on these kinds of silly requests.

It's been a long time since I used WSL. Also don't know why the WSL shell dumped me into a Windows folder.. one simply lacks the imagination that someone would chose to drop that on us.

Anyway I redid the sequence in the home folder, the result was the same:

  This message is shown once once a day. To disable it please create the
  /home/user/.hushlogin file.
  user@NB057:/mnt/c/WINDOWS/system32$ cd ~
  user@NB057:~$ git clone https://github.com/freedaun/spinsite
  Cloning into 'spinsite'...
  Username for 'https://github.com': ---------@gmail.com
  Password for 'https://---------@gmail.com@github.com':
  remote: Enumerating objects: 29, done.
  remote: Counting objects: 100% (29/29), done.
  remote: Compressing objects: 100% (25/25), done.
  remote: Total 29 (delta 1), reused 19 (delta 1), pack-reused 0
  Unpacking objects: 100% (29/29), 2.88 MiB | 1.13 MiB/s, done.
  user@NB057:~$ cd spinsite
  user@NB057:~/spinsite$ spin up --follow-all
  Serving http://127.0.0.1:3000
  Available Routes:
    bartholomew: http://127.0.0.1:3000 (wildcard)
    fileserver: http://127.0.0.1:3000/static (wildcard)
  2023-02-09T07:28:45.430585Z ERROR spin_http: Error processing request: app "bartholomew-template" component "bartholomew" instantiation failed
  
  Caused by:
      Insufficient resources: cannot create a memfd
  2023-02-09T07:28:45.533533Z ERROR spin_http: Error processing request: app "bartholomew-template" component "bartholomew" instantiation failed
  
  Caused by:
      Insufficient resources: cannot create a memfd

As I said, it's been a long time since I used WSL, so I did (several times):

sudo apt upgrade
sudo apt update

After 15 minutes and +350MB i have no change to report (requests to both /static and /):

  user@NB057:~/spinsite$ spin up --follow-all
  Serving http://127.0.0.1:3000
  Available Routes:
    bartholomew: http://127.0.0.1:3000 (wildcard)
    fileserver: http://127.0.0.1:3000/static (wildcard)
  2023-02-09T07:52:41.796839Z ERROR spin_http: Error processing request: app "bartholomew-template" component "fileserver" instantiation failed
  
  Caused by:
      Insufficient resources: cannot create a memfd
  2023-02-09T07:52:47.582941Z ERROR spin_http: Error processing request: app "bartholomew-template" component "bartholomew" instantiation failed
  
  Caused by:
      Insufficient resources: cannot create a memfd

I have also rebooted Windows and redeployed spin. No change.

@lann
Copy link

lann commented Feb 9, 2023

This may be relevant: microsoft/WSL#3542

@itowlson
Copy link

itowlson commented Feb 9, 2023

@freedaun I just set up an Ubuntu 20 distro and tried again and it worked. But when I rolled that distro back to WSL 1, then I got the error you saw. Could you double-check which WSL version your Ubuntu distro is on - is it possible you upgraded the WSL system but didn't rev that distro? Thanks!

@freedaun
Copy link
Author

freedaun commented Feb 13, 2023

Yeah, I got desperate and reinstalled WSL, taking care to select the latest Ubuntu 22 and reran the procedure. Now it works.

Victory, but actually yet another defeat. Whenever I mess with Linux that's what happens. With spin the idea was no longer having to first align the stars and then say a prayer. It's sad. You've put in an effort to help me along, and the general quality seems to be great, yet this leaves a bad taste, and it is therefore likely I will think twice before continuing.

Man I despise Linux, or more precisely the Linux "drink the cool aid" fan boys. An OS should be invisible, and do its tasks without user intervention, be boring. Android and Chrome OS manage to do so. Windows mostly too. Linux instead provides security that is bypassed routinely with sudo, and breaks all the time. Then standard policy is to "blame X", X being everyone and anyone but their precious, it's evil. Linux is a liability. The day that WASM (or whatever) takes over Linux bare metal can't come soon enough.

Excuses for the stupidity of this issue, maybe this helps someone. Thanks.

@itowlson
Copy link

I hear you - I am from a Windows background myself. I will not bore you with the tales of my battles with glibc this and openssl that, but believe me, I hear you. And I'm sorry this has been a frustrating experience for you.

The goal is absolutely that you should be able to run Spin (and, more broadly, Wasm) on Windows, Mac or Linux, completely interchangeably. You should be able to pull down a Spin application, run spin up and not care what the prompt looks like. If you try Spin and Bartholomew in Windows, it should work (at least it did for me). If you're more comfortable in Windows, maybe that's worth a try - though I completely sympathise if you're not motivated to put more time in!

Thanks for giving Spin a go, and sorry again that it hasn't gone well for you.

@mikkelhegn
Copy link
Member

My understanding of the thread above is that this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants