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

MetaCall FaaS Fails to Start After Deployment Attempt (ENOENT: spawn metacall Error) #74

Open
RohanKrMahato opened this issue Feb 12, 2025 · 0 comments

Comments

@RohanKrMahato
Copy link

RohanKrMahato commented Feb 12, 2025

Description

After successfully running MetaCall FaaS, I attempted to deploy using npx metacall-deploy --dev. The deployment process failed with an undefined server error. Since then, FaaS is no longer working. Restarting the service now results in an ENOENT: spawn metacall error.

Note: (Temporary fix) Remove the Cache folder of Faas

  • on windows you can find Cache here: C:\Users\<your PC's user name>\AppData\Roaming\metacall
  • on Ubuntu you can find it here: go to Home directory, show hidden folder, and you will get a folder .metacall

Which OS I tried?

  • I tried on Ubuntu and Windows 11
  • however, I will be providing details below with respect to ubuntu. Since it is almost same on both Ubuntu and Windows 11

Proof, that Faas was working initially

rohan@rohan-virtual-machine:~/Desktop/faas$ npm start

> @metacall/[email protected] start
> npm run build && node dist/index.js


> @metacall/[email protected] build
> npm run lint && tsc


> @metacall/[email protected] lint
> eslint . --max-warnings=0 --ignore-pattern dist

Server is running on the port 9000

What I did?

  • On ubuntu build and installed Metacall Core
  • Cloned the FAAS repository, then did npm install && npm start ( and it ran on Port 9000 )
  • Now I made a folder named basicfaastest and inside it i created two files namely sum.py and main.js
const {sum} = require('./sum.py');

function getsum(a,b){
console.log(sum(a,b));
let temp=sum(a,b);
return temp;
}

module.exports=getsum;
def sum(a,b):
	return a+b
  • Note: I checked these files using metacallcli it is loading properly and these two code don't have any issue.
  • Now, I moved to basicfaastest folder
  • and, installed the deploy tool, npm i @metacall/deploy
  • then executed npx metacall-deploy --dev
  • deploy asked me metacall.json is not present would you like to create it, and then I choose Yes
  • after few steps
  • it asked me if I like to add env variable? I choose Yes
  • then something like this appeared Type env vars in the format: K1=V1, K2=V2 ( I think this is the critical point, here I didn't provided any variable and simply pressed enter)
  • and then it started to deploy
i Deploying /home/rohan/Desktop/basicfaastest...

X Server responded with error code:  undefined
  • along with the error the Faas running in another terminal at port 9000 terminated with the following
node:events:485
      throw er; // Unhandled 'error' event
      ^

Error: spawn metacall ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn metacall',
  path: 'metacall',
  spawnargs: [ '/home/rohan/Desktop/faas/dist/worker/index.js' ]
}

Node.js v23.7.0
  • and now, When ever I write npm start in the faas cloned folder it don't run and give the following error

Image

  • I tried to reinstalled metacall, but that didn't helped, the error is still there.

what configurations i choosed in the deploy? ( for your reference)

rohan@rohan-virtual-machine:~/Desktop/basicfaastest$ npx metacall-deploy --dev
! No metacall.json was found in /home/rohan/Desktop/basicfaastest, launching the wizard...
? Do you want to save metacall.json file? (Y/N): Y
? Select languages to run on MetaCall NodeJS, Python
? Select files to load with NodeJS main.js
? Select files to load with Python sum.py
? Do you want to add environment variables? Yes
? Type env vars in the format: K1=V1, K2=V2 
i Deploying /home/rohan/Desktop/basicfaastest...

X Server responded with error code:  undefined
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

1 participant