0

I have updated my sfdx to latest version

 nagendrasingh@Nagendras-MacBook-Pro javascriptfndemo % sfdx  version
 sfdx-cli/7.121.8 darwin-x64 node-v14.18.0

Ny node version and npm version both are good as per requirement.

nagendrasingh@Nagendras-MacBook-Pro ~ % node --version
v14.17.6
nagendrasingh@Nagendras-MacBook-Pro ~ % npm -version
6.14.15

I have also installed docker for mac for desktop.

But when I run sf function locally, I see an error.

nagendrasingh@Nagendras-MacBook-Pro javascriptfndemo % sf run function start -p 8080 -b 9229

Building javascriptfndemo Error: spawn /usr/local/lib/node_modules/@salesforce/cli/node_modules/@heroku/functions-core/bin/benny-darwin ENOENT Code: ENOENT

Has anyone faced this issue?

SFDX version

nagendrasingh@Nagendras-MacBook-Pro clirepro % sfdx --version
sfdx-cli/7.121.8 darwin-x64 node-v14.18.0

SF Plugin core:

nagendrasingh@Nagendras-MacBook-Pro clirepro % sf plugins --core
@oclif/plugin-help 5.1.1 (core)
@oclif/plugin-not-found 2.2.0 (core)
@oclif/plugin-plugins 2.0.1 (core)
@salesforce/cli 1.0.5 (core)
config 2.2.6 (core)
deploy-retrieve 1.0.3 (core)
deploy-retrieve-metadata 1.0.2 (core)
env 1.0.1 (core)
functions 1.0.3 (core)
generate 1.0.1 (core)
login 1.0.1 (core)
telemetry 1.2.6 (core)

Node Version:

nagendrasingh@Nagendras-MacBook-Pro clirepro % node -v
v14.17.6

NPM Version:

nagendrasingh@Nagendras-MacBook-Pro clirepro % npm version
{
'clirepro-function': '0.0.1',
npm: '6.14.15',
ares: '1.17.2',
brotli: '1.0.9',
cldr: '39.0',
icu: '69.1',
llhttp: '2.1.3',
modules: '83',
napi: '8',
nghttp2: '1.42.0',
node: '14.17.6',
openssl: '1.1.1l',
tz: '2021a',
unicode: '13.0',
uv: '1.41.0',
v8: '8.4.371.23-node.76',
zlib: '1.2.11'
}

MAC OS:

Big Sur : Version 11.6

Docker for Mac

Docker Engine
v20.10.8

FYI (Update) Works perfectly fine with windows system

10
  • I'm getting another another on windows too. [INFO] Downloading and extracting Node v14.18.1 gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now [31;1mERROR: [0mfailed to build: exit status 2 SFDX: Start Function exited unexpectedly Commented Oct 13, 2021 at 6:02
  • 1
    Maybe there is some issue starting the function from cli. I just did start it right from the docker & invoked it from code. It worked! Commented Oct 13, 2021 at 6:17
  • Invoked it from code, what do you mean by this? I thought functions are not yet available in any org. You can only invoke it locally with docker. Commented Oct 13, 2021 at 7:52
  • That's correct. Instead using Start Function from cli. Open Docker & you'll see start button, just start it from their. I'm sure we're missing something that's why it doesn't work with cli. Commented Oct 13, 2021 at 8:13
  • How where you able to push the function to docker? Commented Oct 13, 2021 at 8:43

1 Answer 1

1

It was a permission issue, I installed npm with sudo, which is not a recommended way. I uninstalled node and reinstalled it using brew, https://changelog.com/posts/install-node-js-with-homebrew-on-os-x

And now it works fine. I am able to run functions locally in MAC too without an issue.

 /usr/local/bin/sf run function start -p 8080 -b 9229
Building javafntest
20: Pulling from heroku/buildpacks
f3ef4ff62e0d: Pulling fs layer
c1e24d4cd1ac: Pulling fs layer
6b6e616a3c79: Pulling fs layer
b25f7b6e2c84: Pulling fs layer
dd458b7374ca: Pulling fs layer
bbe63dd68486: Pulling fs layer
b25f7b6e2c84: Waiting
3e9480657c01: Pulling fs layer
357fefdf9bc9: Pulling fs layer
6fa475a1dd3f: Pulling fs layer
dd458b7374ca: Waiting
c3e1c128760e: Pulling fs layer
4b5b9e1c57a2: Pulling fs layer
bbe63dd68486: Waiting
357fefdf9bc9: Waiting
3e9480657c01: Waiting
c3e1c128760e: Waiting
6fa475a1dd3f: Waiting
c7d316117995: Pulling fs layer
8f7ab136a2c9: Pulling fs layer
1f05f35ceef1: Pulling fs layer
c10fd1b9aa75: Pulling fs layer
6a19c4a9cc6d: Pulling fs layer
5035dafe4b03: Pulling fs layer
491c1ce9c4f9: Pulling fs layer
d2a2659301d3: Pulling fs layer
08d54b036422: Pulling fs layer
4b5b9e1c57a2: Waiting
4bfdb67d04f5: Pulling fs layer
0494ca24cd11: Pulling fs layer
c7d316117995: Waiting
ae945079ae39: Pulling fs layer
03fb7dba7baa: Pulling fs layer
80729d88ae8d: Pulling fs layer
e39f36c309b9: Pulling fs layer
8f7ab136a2c9: Waiting
1f05f35ceef1: Waiting
c10fd1b9aa75: Waiting
6a19c4a9cc6d: Waiting
4bfdb67d04f5: Waiting
5035dafe4b03: Waiting
c706262ff70c: Pulling fs layer
491c1ce9c4f9: Waiting
08d54b036422: Waiting
0494ca24cd11: Waiting
d2a2659301d3: Waiting
ae945079ae39: Waiting
6018af265953: Pulling fs layer
f18d74887f79: Pulling fs layer
17d8a8efaf58: Pulling fs layer
9215aa0839f1: Pulling fs layer
4f4fb700ef54: Pulling fs layer
03fb7dba7baa: Waiting
17d8a8efaf58: Waiting
80729d88ae8d: Waiting
e39f36c309b9: Waiting
c706262ff70c: Waiting
6018af265953: Waiting
4f4fb700ef54: Waiting
9215aa0839f1: Waiting
c1e24d4cd1ac: Download complete
b25f7b6e2c84: Verifying Checksum
b25f7b6e2c84: Download complete
f3ef4ff62e0d: Verifying Checksum
f3ef4ff62e0d: Download complete
bbe63dd68486: Verifying Checksum
bbe63dd68486: Download complete
f3ef4ff62e0d: Pull complete
c1e24d4cd1ac: Pull complete
3e9480657c01: Download complete
357fefdf9bc9: Verifying Checksum
357fefdf9bc9: Download complete
6fa475a1dd3f: Verifying Checksum
6fa475a1dd3f: Download complete
c3e1c128760e: Verifying Checksum
c3e1c128760e: Download complete
4b5b9e1c57a2: Verifying Checksum
4b5b9e1c57a2: Download complete
c7d316117995: Verifying Checksum
c7d316117995: Download complete
8f7ab136a2c9: Verifying Checksum
8f7ab136a2c9: Download complete
1f05f35ceef1: Verifying Checksum
1f05f35ceef1: Download complete
c10fd1b9aa75: Verifying Checksum
c10fd1b9aa75: Download complete
6a19c4a9cc6d: Download complete
5035dafe4b03: Verifying Checksum
5035dafe4b03: Download complete
491c1ce9c4f9: Verifying Checksum
491c1ce9c4f9: Download complete
d2a2659301d3: Download complete
08d54b036422: Verifying Checksum
08d54b036422: Download complete
4bfdb67d04f5: Verifying Checksum
4bfdb67d04f5: Download complete
0494ca24cd11: Verifying Checksum
0494ca24cd11: Download complete
ae945079ae39: Verifying Checksum
ae945079ae39: Download complete
03fb7dba7baa: Verifying Checksum
03fb7dba7baa: Download complete
80729d88ae8d: Verifying Checksum
80729d88ae8d: Download complete
e39f36c309b9: Download complete
c706262ff70c: Verifying Checksum
c706262ff70c: Download complete
6018af265953: Download complete
f18d74887f79: Verifying Checksum
f18d74887f79: Download complete
17d8a8efaf58: Download complete
9215aa0839f1: Verifying Checksum
9215aa0839f1: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
6b6e616a3c79: Verifying Checksum
6b6e616a3c79: Download complete
6b6e616a3c79: Pull complete
b25f7b6e2c84: Pull complete
dd458b7374ca: Verifying Checksum
dd458b7374ca: Download complete
dd458b7374ca: Pull complete
bbe63dd68486: Pull complete
3e9480657c01: Pull complete
357fefdf9bc9: Pull complete
6fa475a1dd3f: Pull complete
c3e1c128760e: Pull complete
4b5b9e1c57a2: Pull complete
c7d316117995: Pull complete
8f7ab136a2c9: Pull complete
1f05f35ceef1: Pull complete
c10fd1b9aa75: Pull complete
6a19c4a9cc6d: Pull complete
5035dafe4b03: Pull complete
491c1ce9c4f9: Pull complete
d2a2659301d3: Pull complete
08d54b036422: Pull complete
4bfdb67d04f5: Pull complete
0494ca24cd11: Pull complete
ae945079ae39: Pull complete
03fb7dba7baa: Pull complete
80729d88ae8d: Pull complete
e39f36c309b9: Pull complete
c706262ff70c: Pull complete
6018af265953: Pull complete
f18d74887f79: Pull complete
17d8a8efaf58: Pull complete
9215aa0839f1: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:ba87b3392458b2dc5c9e8791aaff0b95868affba668734335b2c5e2198d9a23c
Status: Downloaded newer image for heroku/buildpacks:20
20: Pulling from heroku/pack
f3ef4ff62e0d: Already exists
c1e24d4cd1ac: Already exists
6b6e616a3c79: Already exists
e705f06d523b: Pulling fs layer
a2c693cbbfc6: Pulling fs layer
a2c693cbbfc6: Verifying Checksum
a2c693cbbfc6: Download complete
e705f06d523b: Verifying Checksum
e705f06d523b: Download complete
e705f06d523b: Pull complete
a2c693cbbfc6: Pull complete
Digest: sha256:47297ad5ff875939fd6f2dfd2a64aea842f3beedbeae070facb85b6747e67104
Status: Downloaded newer image for heroku/pack:20
===> DETECTING
======== Output: heroku/[email protected] ========
no
err:  heroku/[email protected] (1)
heroku/jvm                  0.1.9
heroku/maven                0.2.5
heroku/jvm-function-invoker 0.5.4
===> ANALYZING
Previous image with name "javafntest" not found
===> RESTORING
===> BUILDING
[Installing Java]
JDK 1.8 installed
JRE 1.8 installed
[Installing Maven]
[INFO] Maven wrapper detected, skipping installation.
[Executing Maven]
[INFO] $ ./mvnw -DskipTests clean install
--2021-10-27 03:22:49--  https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Resolving repo.maven.apache.org (repo.maven.apache.org)... 151.101.52.215
Connecting to repo.maven.apache.org (repo.maven.apache.org)|151.101.52.215|:443... 
connected.
HTTP request sent, awaiting response... 200 OK
Length: 50710 (50K) [application/java-archive]
Saving to: '/workspace/.mvn/wrapper/maven-wrapper.jar'
    0K .
......... .......... .......... .......... ......... 100%  173K=0.3s
2021-10-27 03:22:51 (173 KB/s) - '/workspace/.mvn/wrapper/maven-wrapper.jar' saved [50710/50710]
[INFO] Scanning for projects...
[INFO] 
[IN
......
Adding cache layer 'heroku/jvm-function-invoker:runtime'
Starting javafntest
Running on port :8080
Debugger running on port :9229
Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
Listening for transport dt_socket at address: 9229
03:28:49.282 INFO  [RUNTIME] c.s.f.j.r.c.AbstractDetectorCommandImpl - Detecting project type at path /layers/heroku_jvm-function-invoker/bundle...
03:28:49.315 INFO  [RUNTIME] c.s.f.j.r.c.AbstractDetectorCommandImpl - Detected Function Bundle project at path /layers/heroku_jvm-function-invoker/bundle after 26ms!
03:28:49.315 INFO  [RUNTIME] c.s.f.j.r.c.AbstractDetectorCommandImpl - Scanning project for functions...
03:28:50.128 INFO  [RUNTIME] c.s.f.j.r.c.AbstractDetectorCommandImpl - Found 1 function(s) after 813ms.
03:28:50.129 INFO  [RUNTIME] c.s.f.j.r.commands.ServeCommandImpl - Found function: com.example.JavafntestFunction
03:28:50.187 INFO  [RUNTIME] io.undertow - starting server: Undertow - 2.2.11.Final
03:28:50.205 INFO  [RUNTIME] org.xnio - XNIO version 3.8.4.Final
03:28:50.236 INFO  [RUNTIME] org.xnio.nio - XNIO NIO Implementation Version 3.8.4.Final
03:28:50.421 INFO  [RUNTIME] org.jboss.threads - JBoss Threads version 3.1.0.Final
1
  • I also recommend using Volta as your version manager for Node.js, this way all the global packages you install with npm are handled by Volta without needing to deal with permissions. Commented Nov 15, 2021 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .