The application at '⁨/path/UICatalog.app' does not exist or is not accessible : Appium Error on IOS - appium-ios

My set capabilities are
DesiredCapabilities d= new DesiredCapabilities();
d.setCapability(MobileCapabilityType.DEVICE_NAME,"iPhone 8 Plus");
d.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS 12.1");
d.setCapability(MobileCapabilityType.AUTOMATION_NAME,AutomationName.IOS_XCUI_TEST);
d.setCapability(MobileCapabilityType.APP, "⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app");
IOSDriver<IOSElement> driver= new IOSDriver<IOSElement>(new URL("http://127.0.0.1:4723/wd/hub"),d);
I am getting the below error when trying to access .ipa file in appium:
[info] [Appium] Welcome to Appium v1.9.1
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"desiredCapabilities":{"app":"⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app","automationName":"XCuiTest","platformName":"iOS","deviceName":"iPhone 8 Plus"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app","automationName":"XCuiTest","platformName":"iOS","deviceName":"iPhone 8 Plus"},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1541757347221 (15:25:47 GMT+0530 (IST))
[info] [Appium] Creating new XCUITestDriver (v2.94.2) session
[info] [Appium] Capabilities:
[info] [Appium] app: ⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app
[info] [Appium] automationName: XCuiTest
[info] [Appium] platformName: iOS
[info] [Appium] deviceName: iPhone 8 Plus
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"app":"⁨/Users/⁨bhabanimis...
[info] [BaseDriver] Session created with session id: 448234a4-dc13-474d-bc17-a08ada77b861
[debug] [XCUITest] Current user: 'bhabanimishra'[debug] [XCUITest] Xcode version set to '10.1'
[debug] [XCUITest] iOS SDK Version set to '12.1'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1541757347549 (15:25:47 GMT+0530 (IST))[info] [XCUITest] Simulator udid not provided, using desired caps to create a new simulator
[info] [XCUITest] No platformVersion specified. Using latest version Xcode supports: '12.1' This may cause problems if a simulator does not exist for this platform version.[debug] [simctl] Creating simulator with name 'appiumTest-iPhone 8 Plus', device type id 'iPhone 8 Plus' and runtime id '12.1'[info] [iOSSim] Constructing iOS simulator for Xcode version 10.1 with udid '0A22BBD7-8861-4DBE-A7E9-100A8B6A6031'
[info] [XCUITest] Created simulator with udid '0A22BBD7-8861-4DBE-A7E9-100A8B6A6031'.
[info] [XCUITest] Determining device to run tests on: udid: '0A22BBD7-8861-4DBE-A7E9-100A8B6A6031', real device: false
[error] [XCUITest] Error: The application at '⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app' does not exist or is not accessible
[error] [XCUITest] at Object.configureApp$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/helpers.js:97:11)
[error] [XCUITest] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[error] [XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[error] [XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[error] [XCUITest] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[error] [XCUITest] at run (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[error] [XCUITest] at /Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[error] [XCUITest] at flush (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[error] [XCUITest] at process._tickCallback (internal/process/next_tick.js:61:11)
[error] [XCUITest] Error: Bad app: ⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
[error] [XCUITest] at XCUITestDriver.configureApp$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:652:13)
[error] [XCUITest] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[error] [XCUITest] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[error] [XCUITest] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[error] [XCUITest] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[error] [XCUITest] at run (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[error] [XCUITest] at /Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[error] [XCUITest] at flush (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[error] [XCUITest] at process._tickCallback (internal/process/next_tick.js:61:11)
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [XCUITest] Deleting simulator created for this run (udid: '0A22BBD7-8861-4DBE-A7E9-100A8B6A6031')
[debug] [XCUITest] Killing running processes 'xcodebuild.*0A22BBD7-8861-4DBE-A7E9-100A8B6A6031, 0A22BBD7-8861-4DBE-A7E9-100A8B6A6031.*XCTRunner' for the device 0A22BBD7-8861-4DBE-A7E9-100A8B6A6031...
[debug] [XCUITest] 'pgrep -nif xcodebuild.*0A22BBD7-8861-4DBE-A7E9-100A8B6A6031' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -nif 0A22BBD7-8861-4DBE-A7E9-100A8B6A6031.*XCTRunner' didn't detect any matching processes. Return code: 1[debug] [BaseDriver] Event 'newSessionStarted' logged at 1541757351769 (15:25:51 GMT+0530 (IST))
[debug] [MJSONWP] Encountered internal error running command: Error: Bad app: ⁨/Users/⁨bhabanimishra⁩/Desktop/UICatalog.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
[debug] [MJSONWP] at XCUITestDriver.configureApp$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:652:13)
[debug] [MJSONWP] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [MJSONWP] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [MJSONWP] at run (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[debug] [MJSONWP] at /Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[debug] [MJSONWP] at flush (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[debug] [MJSONWP] at process._tickCallback (internal/process/next_tick.js:61:11)
[info] [HTTP] <-- POST /wd/hub/session 500 4551 ms - 327
[info] [HTTP]

Always check the path using command line:
Navigate to the specific folder your .app file is in and run command as
ls
This should come up listing your .app file , no run command
pwd
It will return the correct path where you are at present.copy the same and put it in the DesiredCapability
File appDir = new File("/Users/VSBist/Desktop/AppsToTest");
/*IOS DEPENDENCIES START */
File newApp = new File (appDir ,"YourApp.app");
cap.setCapability(CapabilityType.BROWSER_NAME, "");
cap.setCapability("deviceName", "iPhone 6");
cap.setCapability("platformName", "iOS");
cap.setCapability("automationName", "XCUItest");
cap.setCapability("platformVersion","12.0");
cap.setCapability("connectHardwareKeyboard", false);
/*IOS DEPENDENCIES ENDS */

I Used a Driver wait Function and it Resolved the Issue
URL url = new URL ("http://127.0.0.1:4723/wd/hub");
Driver = new AppiumDriver<MobileElement>(url,DC);
wait = new WebDriverWait(Driver, 10);
System.out.println("Calculator Started::");
and Yes, You can WebDriver wait in AppiumDriver Tests.

Related

Not able to use realtime local emulator database

I followed some tutorials to use local emulators on my laptop.
the installation went well and I could start the emulator.
I see the realtime Database in green and can see the empty DB.
But from there, I am not able to do anything at all:
Import a DB: I get the following error: "NetworkError when attempting to fetch resource."
Adding some fields/Values in the Database from the GUI:
- I don't have any "+" sign to add values.
- I cannot save the values I put.
- I can see "Edit" or "Delete" button, but they have no effect...
There is something going wrong somewhere and that may be due to some config, but I don't know what that should be.
I don't find documentation relatively and did not find any "Google" article relatively.
Any support would be very welcome as I am currently blocked with my project.
Thank you.
LOGS:
database-debug.log
*Picked up JAVA_TOOL_OPTIONS: -Xmx4g
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/root/.cache/firebase/emulators/firebase-database-emulator-v4.9.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
17:34:03.761 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
17:34:03.894 [main] INFO com.firebase.server.forge.App$ - Listening at 127.0.0.1:9000*
firebase-debug.log
*_[debug] [2022-10-01T00:34:02.410Z] ----------------------------------------------------------------------
[debug] [2022-10-01T00:34:02.412Z] Command: /usr/local/bin/firebase /root/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase emulators:start
[debug] [2022-10-01T00:34:02.412Z] CLI Version: 11.12.0
[debug] [2022-10-01T00:34:02.412Z] Platform: linux
[debug] [2022-10-01T00:34:02.412Z] Node Version: v16.16.0
[debug] [2022-10-01T00:34:02.412Z] Time: Fri Sep 30 2022 17:34:02 GMT-0700 (Pacific Daylight Time)
[debug] [2022-10-01T00:34:02.413Z] ----------------------------------------------------------------------
[debug]
[debug] [2022-10-01T00:34:02.471Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2022-10-01T00:34:02.472Z] > authorizing via signed-in user (ebonnefoy#rbbn.com)
[debug] [2022-10-01T00:34:02.481Z] Picked up JAVA_TOOL_OPTIONS: -Xmx4g
[debug] [2022-10-01T00:34:02.513Z] openjdk version "11.0.16" 2022-07-19
[debug] [2022-10-01T00:34:02.514Z] OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1, mixed mode, sharing)
[debug] [2022-10-01T00:34:02.523Z] Parsed Java major version: 11
[info] i emulators: Starting emulators: auth, database {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, database"}}
[debug] [2022-10-01T00:34:02.536Z] [hub] writing locator at /tmp/hub-testemul01.json
[debug] [2022-10-01T00:34:02.543Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/testemul01 [none]
[debug] [2022-10-01T00:34:02.747Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/testemul01 200
[debug] [2022-10-01T00:34:02.748Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/testemul01 {"projectId":"testemul01","projectNumber":"820099885379","displayName":"testemul1","name":"projects/testemul01","resources":{"hostingSite":"testemul01"},"state":"ACTIVE","etag":"1_e1300143-b10e-4def-88a1-a6736b7b5a04"}
[debug] [2022-10-01T00:34:02.749Z] database rules config: []
[warn] ⚠ database: Did not find a Realtime Database rules file specified in a firebase.json config file. The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration. {"metadata":{"emulator":{"name":"database"},"message":"Did not find a Realtime Database rules file specified in a firebase.json config file. The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration."}}
[debug] [2022-10-01T00:34:02.758Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: projectId"}}
[debug] [2022-10-01T00:34:02.758Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2022-10-01T00:34:02.758Z] Ignoring unsupported arg: rules {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: rules"}}
[debug] [2022-10-01T00:34:02.758Z] Starting Database Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/root/.cache/firebase/emulators/firebase-database-emulator-v4.9.0.jar","--host","127.0.0.1","--port",9000],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host"],"joinArgs":false} {"metadata":{"emulator":{"name":"database"},"message":"Starting Database Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/root/.cache/firebase/emulators/firebase-database-emulator-v4.9.0.jar","--host","127.0.0.1","--port",9000],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host"],"joinArgs":false}"}}
[info] i database: Database Emulator logging to database-debug.log {"metadata":{"emulator":{"name":"database"},"message":"Database Emulator logging to \u001b[1mdatabase-debug.log\u001b[22m"}}
[debug] [2022-10-01T00:34:02.771Z] Picked up JAVA_TOOL_OPTIONS: -Xmx4g
{"metadata":{"emulator":{"name":"database"},"message":"Picked up JAVA_TOOL_OPTIONS: -Xmx4g\n"}}
[debug] [2022-10-01T00:34:03.258Z] WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/root/.cache/firebase/emulators/firebase-database-emulator-v4.9.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
{"metadata":{"emulator":{"name":"database"},"message":"WARNING: An illegal reflective access operation has occurred\nWARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/root/.cache/firebase/emulators/firebase-database-emulator-v4.9.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys\nWARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil\nWARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\nWARNING: All illegal access operations will be denied in a future release\n"}}
[debug] [2022-10-01T00:34:03.763Z] 17:34:03.761 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
{"metadata":{"emulator":{"name":"database"},"message":"17:34:03.761 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started\n"}}
[debug] [2022-10-01T00:34:03.895Z] 17:34:03.894 [main] INFO com.firebase.server.forge.App$ - Listening at 127.0.0.1:9000
{"metadata":{"emulator":{"name":"database"},"message":"17:34:03.894 [main] INFO com.firebase.server.forge.App$ - Listening at 127.0.0.1:9000\n"}}
[debug] [2022-10-01T00:34:09.740Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2022-10-01T00:34:09.740Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[debug] [2022-10-01T00:34:09.741Z] Starting Emulator UI with command {"binary":"node","args":["/root/.cache/firebase/emulators/ui-v1.9.0/server/server.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {"binary":"node","args":["/root/.cache/firebase/emulators/ui-v1.9.0/server/server.js"],"optionalArgs":[],"joinArgs":false}"}}
[info] i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[debug] [2022-10-01T00:34:09.903Z] Web / API server started at 127.0.0.1:4000
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at 127.0.0.1:4000\n"}}
[info]
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
│ i View Emulator UI at http://127.0.0.1:4000 │
└─────────────────────────────────────────────────────────────┘
┌────────────────┬────────────────┬────────────────────────────────┐
│ Emulator │ Host:Port │ View in Emulator UI │
├────────────────┼────────────────┼────────────────────────────────┤
│ Authentication │ 127.0.0.1:9099 │ http://127.0.0.1:4000/auth │
├────────────────┼────────────────┼────────────────────────────────┤
│ Database │ 127.0.0.1:9000 │ http://127.0.0.1:4000/database │
└────────────────┴────────────────┴────────────────────────────────┘
Emulator Hub running at localhost:4400
Other reserved ports: 4500*

Getting an error when attempting to mock location in Appium on iOS simulator using driver.setLocation

I am trying to set the location on my iOS simulator within my appium test using the driver.setLocation method.
Here is the response from appium logs:
[HTTP] --> POST /wd/hub/session/dfad6b21-23de-4d3c-9157-8832df4815f5/location
[HTTP] {"location":{"altitude":0,"latitude":53.427573,"class":"org.openqa.selenium.html5.Location","longitude":-6.243413}}
[debug] [W3C (dfad6b21)] Calling AppiumDriver.setGeoLocation() with args: [{"altitude":0,"latitude":53.38977,"class":"org.openqa.selenium.html5.Location","longitude":-6.10934},"dfad6b21-23de-4d3c-9157-8832df4815f5"]
[debug] [XCUITest] Executing command 'setGeoLocation'
[iOSSim] 'set-simulator-location' binary has not been found in your PATH. Please install it as "brew install lyft/formulae/set-simulator-location" by brew or read https://github.com/lyft/set-simulator-location to set the binary by manual to be able to set geolocation by the library.
[iOSSim] Failed to set geolocation with idb because it is not installed or the "launchWithIDB" capability was not set
[iOSSim] spawn /usr/bin/python ENOENT
[debug] [W3C (dfad6b21)] Encountered internal error running command: Error: spawn /usr/bin/python ENOENT
[debug] [W3C (dfad6b21)] at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
[debug] [W3C (dfad6b21)] at onErrorNT (node:internal/child_process:476:16)
[debug] [W3C (dfad6b21)] at processTicksAndRejections (node:internal/process/task_queues:82:21)
[HTTP] <-- POST /wd/hub/session/dfad6b21-23de-4d3c-9157-8832df4815f5/location 500 66 ms - 635
[HTTP]

"Unexpected" error when trying to start Local Firebase Emulators

I'm trying to start local firebase emulators to test Cloud Functions, but when I use the command "firebase emulators:start" or "firebase emulators:start --only functions" I get an "Error: An unexpected error has occurred". Looking deeply into the log, I found out that there is a javascript error showing up:
at new Table (/usr/local/lib/node_modules/firebase-tools/node_modules/cli-table/lib/index.js:51:15)
at Command.actionFn (/usr/local/lib/node_modules/firebase-tools/lib/commands/emulators-start.js:47:33)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Can you please help me on this issue?
My firebase.debug file:
[debug] [2021-11-18T14:17:55.225Z] ----------------------------------------------------------------------
[debug] [2021-11-18T14:17:55.227Z] Command: /usr/local/bin/node /usr/local/bin/firebase emulators:start --only functions
[debug] [2021-11-18T14:17:55.228Z] CLI Version: 9.22.0
[debug] [2021-11-18T14:17:55.228Z] Platform: darwin
[debug] [2021-11-18T14:17:55.228Z] Node Version: v14.16.1
[debug] [2021-11-18T14:17:55.228Z] Time: Thu Nov 18 2021 11:17:55 GMT-0300
[debug] [2021-11-18T14:17:55.228Z] ----------------------------------------------------------------------
[debug]
[debug] [2021-11-18T14:17:55.279Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2021-11-18T14:17:55.279Z] > authorizing via signed-in user
[info] i emulators: Starting emulators: functions {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions"}}
[warn] ⚠ emulators: It seems that you are running multiple instances of the emulator suite for project myproject-cloud. This may result in unexpected behavior.
[debug] [2021-11-18T14:17:55.296Z] [hub] writing locator at /var/folders/fh/z2w8wkl147gd2q4wvc281x5r0000gn/T/hub-myproject-cloud.json
[warn] ⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, firestore, database, hosting, pubsub, storage {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mauth, firestore, database, hosting, pubsub, storage\u001b[22m"}}
[info] ✔ functions: Using node#14 from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node#14 from host."}}
[debug] [2021-11-18T14:17:55.335Z] defaultcredentials: writing to file /Users/artiste/.config/firebase/artiste_gmail_com_application_default_credentials.json
[debug] [2021-11-18T14:17:55.339Z] Setting GAC to /Users/artiste/.config/firebase/artiste_gmail_com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /Users/artiste/.config/firebase/artiste_gmail_com_application_default_credentials.json"}}
[debug] [2021-11-18T14:17:55.342Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/myproject-cloud/adminSdkConfig [none]
[debug] [2021-11-18T14:17:56.394Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/myproject-cloud/adminSdkConfig 200
[debug] [2021-11-18T14:17:56.394Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/myproject-cloud/adminSdkConfig {"projectId":"myproject-cloud","storageBucket":"myproject-cloud.appspot.com","locationId":"southamerica-east1"}
[warn] ⚠ ui: Emulator UI unable to start on port 4000, starting on 4010 instead. {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI unable to start on port 4000, starting on 4010 instead."}}
[debug] [2021-11-18T14:17:56.965Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2021-11-18T14:17:56.965Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[debug] [2021-11-18T14:17:56.965Z] Starting Emulator UI with command {"binary":"node","args":["/Users/artiste/.cache/firebase/emulators/ui-v1.6.4/server.bundle.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/Users/artiste/.cache/firebase/emulators/ui-v1.6.4/server.bundle.js\"],\"optionalArgs\":[],\"joinArgs\":false}"}}
[info] i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[debug] [2021-11-18T14:17:57.055Z] Web / API server started at localhost:4010
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at localhost:4010\n"}}
[info] i functions: Watching "/Users/artiste/Developer/myproject_functions/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/Users/artiste/Developer/myproject_functions/functions\" for Cloud Functions..."}}
[debug] [2021-11-18T14:17:57.241Z] [worker-pool] addWorker(~diagnostic~) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(~diagnostic~)"}}
[debug] [2021-11-18T14:17:57.241Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key ~diagnostic~, total=1"}}
[debug] [2021-11-18T14:17:57.242Z] [worker-pool] submitWork(triggerId=) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=)"}}
[debug] [2021-11-18T14:17:57.242Z] [worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: Assigning socketPath: /var/folders/fh/z2w8wkl147gd2q4wvc281x5r0000gn/T/fire_emu_52240.sock {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: Assigning socketPath: /var/folders/fh/z2w8wkl147gd2q4wvc281x5r0000gn/T/fire_emu_52240.sock"}}
[debug] [2021-11-18T14:17:57.242Z] [worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: BUSY"}}
[debug] [2021-11-18T14:17:57.363Z] [runtime-status] [52240] Functions runtime initialized. {"cwd":"/Users/artiste/Developer/myproject_functions/functions","node_version":"14.16.1"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Functions runtime initialized. {\"cwd\":\"/Users/artiste/Developer/myproject_functions/functions\",\"node_version\":\"14.16.1\"}"}}
[debug] [2021-11-18T14:17:57.364Z] [runtime-status] [52240] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Disabled runtime features: undefined"}}
[debug] [2021-11-18T14:17:57.367Z] [runtime-status] [52240] Resolved module firebase-admin {"declared":true,"installed":true,"version":"9.12.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"9.12.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.370Z] [runtime-status] [52240] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.16.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.16.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.372Z] [runtime-status] [52240] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[debug] [2021-11-18T14:17:57.372Z] [runtime-status] [52240] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.16.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.16.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.429Z] [runtime-status] [52240] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Checked functions.config() {\"config\":{}}"}}
[debug] [2021-11-18T14:17:57.429Z] [runtime-status] [52240] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.16.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.16.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js\"}}"}}
[debug] [2021-11-18T14:17:57.430Z] [runtime-status] [52240] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.16.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.16.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.430Z] [runtime-status] [52240] Resolved module firebase-admin {"declared":true,"installed":true,"version":"9.12.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"9.12.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.431Z] [runtime-status] [52240] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.16.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.16.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2021-11-18T14:17:57.431Z] [runtime-status] [52240] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"9.12.0","resolution":"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"9.12.0\",\"resolution\":\"/Users/artiste/Developer/myproject_functions/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[debug] [2021-11-18T14:17:57.433Z] [runtime-status] [52240] initializeApp(DEFAULT) {"storageBucket":"myproject-cloud.appspot.com","projectId":"myproject-cloud"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [52240] initializeApp(DEFAULT) {\"storageBucket\":\"myproject-cloud.appspot.com\",\"projectId\":\"myproject-cloud\"}"}}
[debug] [2021-11-18T14:17:57.436Z] addAuthTrigger {"eventTrigger":{"resource":"projects/myproject-cloud","eventType":"providers/firebase.auth/eventTypes/user.create","service":"firebaseauth.googleapis.com"}}
[info] ✔ functions[us-central1-createWallet]: auth function initialized. {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mauth\u001b[22m function initialized."}}
[info] ✔ functions[us-central1-addMessage]: http function initialized (http://localhost:5001/myproject-cloud/us-central1/addMessage). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://localhost:5001/myproject-cloud/us-central1/addMessage)."}}
[info] i functions[us-central1-makeUppercase]: function ignored because the firestore emulator does not exist or is not running. {"metadata":{"emulator":{"name":"functions"},"message":"function ignored because the firestore emulator does not exist or is not running."}}
[debug] [2021-11-18T14:17:57.440Z] [worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: IDLE {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-ef847c42-9516-4e42-bacf-72e8e9feb533]: IDLE"}}
[debug] [2021-11-18T14:17:57.687Z] TypeError: Cannot read property 'rows' of undefined
at new Table (/usr/local/lib/node_modules/firebase-tools/node_modules/cli-table/lib/index.js:51:15)
at Command.actionFn (/usr/local/lib/node_modules/firebase-tools/lib/commands/emulators-start.js:47:33)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
[error]
[error] Error: An unexpected error has occurred.
My firebase.json file:
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"emulators": {
"firestore": {
"port": 5002
}
}
}
Thank you.
This seemed to be a bug in Firebase.
It's gone after updating to the latest version (9.23.0) with for example:
npm i -g firebase-tools#latest

Cannot run flow in corda node

I am running a corda network on kubernetes (corda version 4.4) and I am trying to install and run a cordapp .
The cordapp am trying to run is the Heartbeat one (from the github corda sample folder) .
But whenever I try to start the flow using the command start StartHeartbeatFlow
I get the following error message :
[INFO] 11:00:32+0200 [pool-2-thread-11] shell.StartShellCommand.main - Executing command "start StartHeartbeatFlow <no arguments>",
start StartHeartbeatFlow: exception: com.heartbeat.StartHeartbeatFlow
Tue Apr 07 11:00:32 CEST 2020>>> [ERROR] 11:00:32+0200 [pool-2-thread-11] command.CRaSHSession.execute - Error while evaluating request 'start StartHeartbeatFlow' start StartHeartbeatFlow: exception: com.heartbeat.StartHeartbeatFlow [errorCode=1oe81or, moreInformationAt=https://errors.corda.net/OS/4.4/1oe81or]
Which doesn't really help me on how to solve the issue :/
Running flow list is listing the StartHeartbeatFlow so it's not an issue with the installation of the cordapp ...
Has anyone encountered the same kind of issue ?
Thanks !
Edit : The logs in the corda node I have when I execute the flow start StartHeartbeatFlow command .
corda#corda-node-corda-node-0:~/logs$ tail -f corda-node.log | grep -A 10 -B 10 "heartbeat"
[DEBUG] 2020-04-07T13:21:09,767Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] realm.AuthenticatingRealm. - Looked up AuthenticationInfo [rpcuser] from doGetAuthenticationInfo
[DEBUG] 2020-04-07T13:21:09,767Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] realm.AuthenticatingRealm. - AuthenticationInfo caching is disabled for info [rpcuser]. Submitted token: [org.apache.shiro.authc.UsernamePasswordToken - rpcuser, rememberMe=false].
[DEBUG] 2020-04-07T13:21:09,767Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] credential.SimpleCredentialsMatcher. - Performing credentials equality check for tokenCredentials of type [[C and accountCredentials of type [java.lang.String]
[DEBUG] 2020-04-07T13:21:09,767Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] credential.SimpleCredentialsMatcher. - Both credentials arguments can be easily converted to byte arrays. Performing array equals comparison
[DEBUG] 2020-04-07T13:21:09,767Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] authc.AbstractAuthenticator. - Authentication successful for token [org.apache.shiro.authc.UsernamePasswordToken - rpcuser, rememberMe=false]. Returned account [rpcuser]
[DEBUG] 2020-04-07T13:21:09,768Z [Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] artemis.BrokerJaasLoginModule. - Login for rpcuser succeeded
[DEBUG] 2020-04-07T13:21:09,771Z [Thread-12 (ActiveMQ-client-global-threads)] rpc.RPCServer. - -> RPC by rpcuser -> registeredFlows
[DEBUG] 2020-04-07T13:21:09,772Z [Thread-12 (ActiveMQ-client-global-threads)] rpc.RPCServer. - Arguments: [] {actor_id=rpcuser, actor_owning_identity=OU=Regular Node, O=organization, L=Brussels, C=BE, actor_store_id=NODE_CONFIG, invocation_id=aac88106-cf60-4c63-b1b9-c5fac224b89a, invocation_timestamp=2020-04-07T13:21:09.771Z, origin=rpcuser, session_id=df6cc401-6f9f-41b5-9a18-790c28e33b06, session_timestamp=2020-04-07T13:11:30.204Z}
[DEBUG] 2020-04-07T13:21:09,772Z [rpc-server-handler-pool-1] realm.AuthorizingRealm. - No authorizationCache instance set. Checking for a cacheManager... {actor_id=rpcuser, actor_owning_identity=OU=Regular Node, O=organization, L=Brussels, C=BE, actor_store_id=NODE_CONFIG, invocation_id=aac88106-cf60-4c63-b1b9-c5fac224b89a, invocation_timestamp=2020-04-07T13:21:09.771Z, origin=rpcuser, session_id=df6cc401-6f9f-41b5-9a18-790c28e33b06, session_timestamp=2020-04-07T13:11:30.204Z}
[DEBUG] 2020-04-07T13:21:09,772Z [rpc-server-handler-pool-1] realm.AuthorizingRealm. - No cache or cacheManager properties have been set. Authorization cache cannot be obtained. {actor_id=rpcuser, actor_owning_identity=OU=Regular Node, O=organization, L=Brussels, C=BE, actor_store_id=NODE_CONFIG, invocation_id=aac88106-cf60-4c63-b1b9-c5fac224b89a, invocation_timestamp=2020-04-07T13:21:09.771Z, origin=rpcuser, session_id=df6cc401-6f9f-41b5-9a18-790c28e33b06, session_timestamp=2020-04-07T13:11:30.204Z}
[DEBUG] 2020-04-07T13:21:09,773Z [rpc-server-sender] rpc.RPCServer. - <- RPC <- RpcReply(id=10ea96d9-5c19-4200-a64e-1eb3903835ce, timestamp: 2020-04-07T13:21:09.748Z, entityType: Invocation, result=Success([com.heartbeat.StartHeartbeatFlow, net.corda.core.flows.ContractUpgradeFlow$Authorise, net.corda.core.flows.ContractUpgradeFlow$Deauthorise, net.corda.core.flows.ContractUpgradeFlow$Initiate]), deduplicationIdentity=9c974c01-08af-44d0-bdef-c609efee11a8)
[DEBUG] 2020-04-07T13:21:09,775Z [Thread-62 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] artemis.BrokerJaasLoginModule. - Processing login for SystemUsers/NodeRPC
[DEBUG] 2020-04-07T13:21:09,775Z [Thread-62 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#2f4a89fa)] artemis.BrokerJaasLoginModule. - Login for SystemUsers/NodeRPC succeeded
[DEBUG] 2020-04-07T13:21:09,809Z [Network Map Updater Thread-1] pool.PoolBase. - HikariPool-1 - Reset (autoCommit) on connection org.postgresql.jdbc.PgConnection#6fa7296c
[DEBUG] 2020-04-07T13:21:10,560Z [RxIoScheduler-2] network.NodeInfoWatcher. - pollDirectory /opt/corda/additional-node-infos
[DEBUG] 2020-04-07T13:21:10,560Z [RxIoScheduler-2] network.NodeInfoWatcher. - Examining /opt/corda/additional-node-infos/nodeInfo-FEBE485DF04D12B91F70740AC3EDDDB1A0C5058B017C6DD6046A1AF37AB1687D
[DEBUG] 2020-04-07T13:21:10,560Z [RxIoScheduler-2] network.NodeInfoWatcher. - Read 0 NodeInfo files from /opt/corda/additional-node-infos
[DEBUG] 2020-04-07T13:21:10,560Z [RxIoScheduler-2] network.NodeInfoWatcher. - Number of removed NodeInfo files 0
[DEBUG] 2020-04-07T13:21:11,824Z [Network Map Updater Thread-1] pool.PoolBase. - HikariPool-1 - Reset (autoCommit) on connection org.postgresql.jdbc.PgConnection#6fa7296c
[DEBUG] 2020-04-07T13:21:13,844Z [Network Map Updater Thread-1] pool.PoolBase. - HikariPool-1 - Reset (autoCommit) on connection org.postgresql.jdbc.PgConnection#6fa7296c
[DEBUG] 2020-04-07T13:21:15,559Z [RxIoScheduler-2] network.NodeInfoWatcher. - pollDirectory /opt/corda/additional-node-infos
I could invoke the flow from the standalone shell , I was having some weird issues with the /cordapp folder holding my cordapp locally . I deleted it and recreated it and now it works .
Can you update your question with more stack trace? Are there any other errors in your node's log file? I'm asking because I just tried the example and it worked for me.
Here's what I did:
Built the Java version:
// Browse to Java files.
cd /heartbeat/contracts-java
// Build the nodes (Notary and PartyA).
./../gradlew deployNodes
Start the nodes (I don't like using runnodes task, so I start each node individually):
// Terminal 1 (Notary).
cd /heartbeat/contracts-java/build/nodes/Notary
// Start the Notary.
java -jar corda.jar
// Terminal 2 (PartyA).
cd /heartbeat/contracts-java/build/nodes/PartyA
// Start PartyA.
java -jar corda.jar
Start the flow inside of PartyA's terminal. Notice that I use flow start instead of just start (like in your case); it's worth trying flow start, even though both should work:
flow start StartHeartbeatFlow
You will see in my screenshot below that the flow completed (i.e. it created the SchedulableState that will start the flow again, which will lead to an endless loop until you shutdown the node):
Now I can watch that flow being called again and again by typing the below in PartyA's terminal:
flow watch
I could invoke the flow from the standalone shell , I was having some weird issues with the /cordapp folder holding my cordapp locally . I deleted it and recreated it and now it works .

Unit test timeout when testing Firestore

I have several unit tests to test different Repositories of collections in Firestore.
If I run the entire unit tests, the first two of the Firestore unit tests run fine without timeout, but the subsequent ones get timeout all the time.
If I run the failing ones each on its own (i.e. using describe.only()) then it runs just fine without getting any timeout.
In the firestore-debug.log, I see the following entries:
----------------------------------------------------------------------
[debug] [2019-12-25T04:29:17.643Z] Command: /usr/local/bin/node /usr/local/bin/firebase emulators:exec mocha --recursive
[debug] [2019-12-25T04:29:17.643Z] CLI Version: 7.9.0
[debug] [2019-12-25T04:29:17.643Z] Platform: darwin
[debug] [2019-12-25T04:29:17.643Z] Node Version: v12.13.1
[debug] [2019-12-25T04:29:17.647Z]
----------------------------------------------------------------------
[debug] [2019-12-25T04:29:17.647Z]
[debug] [2019-12-25T04:29:17.658Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2019-12-25T04:29:17.658Z] > authorizing via signed-in user
[info] i emulators: Starting emulators: functions, firestore, hosting
[warn] ⚠ Your requested "node" version "8" doesn't match your global version "12"
[info] ✔ functions: Emulator started at http://localhost:5001
[info] i firestore: Serving ALL traffic (including WebChannel) on http://localhost:5002
[warn] ⚠ firestore: Support for WebChannel on a separate port (5003) is DEPRECATED and will go away soon. Please use port above instead.
[debug] [2019-12-25T04:29:17.994Z] Ignoring unsupported arg: projectId
[debug] [2019-12-25T04:29:17.994Z] Ignoring unsupported arg: auto_download
[debug] [2019-12-25T04:29:17.994Z] Starting emulator firestore with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/yoda/.cache/firebase/emulators/cloud-firestore-emulator-v1.10.2.jar","--host","localhost","--port",5002,"--rules","/Users/yoda/Projects/p0rnhub/service/firestore.rules","--functions_emulator","localhost:5001","--webchannel_port",5003],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator"],"joinArgs":false}
[info] i firestore: Emulator logging to firestore-debug.log
[debug] [2019-12-25T04:29:19.869Z] API endpoint: http://
[debug] [2019-12-25T04:29:19.869Z] localhost:5002
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
export FIRESTORE_EMULATOR_HOST=localhost:
[debug] [2019-12-25T04:29:19.869Z] 5002
Dev App Server is now running.
[info] ✔ firestore: Emulator started at http://localhost:5002
[info] i firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:5002
[debug] [2019-12-25T04:29:20.035Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2019-12-25T04:29:20.036Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2019-12-25T04:29:20.185Z] <<< HTTP RESPONSE 200
[debug] [2019-12-25T04:29:20.200Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/p0rnhub/webApps/-/config
[debug] [2019-12-25T04:29:21.157Z] <<< HTTP RESPONSE 200
[info] i hosting: Serving hosting files from: public
[info] ✔ hosting: Local server: http://localhost:5000
[info] ✔ hosting: Emulator started at http://localhost:5000
[info] i functions: Watching "/Users/yoda/Projects/p0rnhub/service/functions" for Cloud Functions...
[debug] [2019-12-25T04:29:21.435Z] [worker-~diagnostic~-8c5a2752-d4c3-408b-b55c-df1aba3f5987]: Assigning socketPath: /var/folders/h5/x3f6g38d1n5_wd1mrk8_ckm00000gn/T/fire_emu_67092.sock
[debug] [2019-12-25T04:29:21.435Z] [worker-~diagnostic~-8c5a2752-d4c3-408b-b55c-df1aba3f5987]: BUSY
[debug] [2019-12-25T04:29:21.804Z] [runtime-status] [67092] Functions runtime initialized. {"cwd":"/Users/yoda/Projects/p0rnhub/service/functions","node_version":"12.13.1"}
[debug] [2019-12-25T04:29:21.806Z] [runtime-status] [67092] Disabled runtime features: undefined
[debug] [2019-12-25T04:29:21.810Z] [runtime-status] [67092] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.8.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-admin/lib/index.js"}
[debug] [2019-12-25T04:29:21.812Z] [runtime-status] [67092] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.3.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-functions/lib/index.js"}
[debug] [2019-12-25T04:29:22.124Z] [runtime-status] [67092] Found google-gax at /Users/yoda/Projects/p0rnhub/service/functions/node_modules/google-gax/build/src/index.js
[debug] [2019-12-25T04:29:22.124Z] [runtime-status] [67092] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"},{"name":"google-gax","status":"mocked"}]
[debug] [2019-12-25T04:29:22.178Z] [runtime-status] [67092] Checked functions.config() {"config":{}}
[debug] [2019-12-25T04:29:22.179Z] [runtime-status] [67092] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.3.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-functions/lib/index.js"}
[debug] [2019-12-25T04:29:22.180Z] [runtime-status] [67092] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.8.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-admin/lib/index.js"}
[debug] [2019-12-25T04:29:22.180Z] [runtime-status] [67092] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.3.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-functions/lib/index.js"}
[debug] [2019-12-25T04:29:22.232Z] [runtime-status] [67092] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"8.8.0","resolution":"/Users/yoda/Projects/p0rnhub/service/functions/node_modules/firebase-admin/lib/index.js"}}
[info] ✔ functions[auth]: http function initialized (http://localhost:5001/p0rnhub/us-central1/auth).
[info] ✔ functions[token]: http function initialized (http://localhost:5001/p0rnhub/us-central1/token).
[info] ✔ functions[login]: http function initialized (http://localhost:5001/p0rnhub/us-central1/login).
[info] ✔ functions[start]: http function initialized (http://localhost:5001/p0rnhub/us-central1/start).
[info] ✔ functions[stop]: http function initialized (http://localhost:5001/p0rnhub/us-central1/stop).
[info] ✔ functions[list]: http function initialized (http://localhost:5001/p0rnhub/us-central1/list).
[info] i Running script: mocha --recursive
[debug] [2019-12-25T04:29:22.252Z] Running mocha --recursive with environment {"npm_config_save_dev":"","npm_config_legacy_bundling":"","npm_config_dry_run":"","npm_config_viewer":"man","npm_config_only":"","npm_config_commit_hooks":"true","npm_config_browser":"","npm_config_also":"","npm_config_sign_git_commit":"","npm_config_rollback":"true","TERM_PROGRAM":"Apple_Terminal","NODE":"/usr/local/bin/node","npm_config_usage":"","npm_config_audit":"true","INIT_CWD":"/Users/yoda/Projects/p0rnhub/service/functions","npm_package_devDependencies_sinon":"^7.5.0","npm_config_globalignorefile":"/usr/local/etc/npmignore","npm_package_devDependencies_mocha":"^6.2.2","TERM":"xterm-256color","SHELL":"/bin/zsh","npm_config_shell":"/bin/zsh","npm_config_maxsockets":"50","npm_config_init_author_url":"","npm_config_shrinkwrap":"true","npm_config_parseable":"","npm_config_metrics_registry":"https://registry.npmjs.org/","TMPDIR":"/var/folders/h5/x3f6g38d1n5_wd1mrk8_ckm00000gn/T/","npm_config_timing":"","npm_config_init_license":"ISC","npm_config_if_present":"","TERM_PROGRAM_VERSION":"433","npm_config_sign_git_tag":"","npm_config_init_author_email":"","npm_config_cache_max":"Infinity","npm_package_dependencies_uuid":"^3.3.3","npm_config_preid":"","npm_config_long":"","npm_config_local_address":"","npm_config_git_tag_version":"true","npm_config_cert":"","TERM_SESSION_ID":"AD305AB7-88B6-4E8E-9681-273EEB25429A","npm_config_registry":"https://registry.npmjs.org/","npm_config_noproxy":"","npm_config_fetch_retries":"2","npm_package_private":"true","npm_config_versions":"","npm_config_message":"%s","npm_config_key":"","npm_package_description":"Cloud Functions for Firebase","USER":"yoda","npm_package_scripts_deploy":"firebase deploy --only functions","npm_config_globalconfig":"/usr/local/etc/npmrc","npm_package_scripts_shell":"firebase functions:shell","npm_config_prefer_online":"","npm_config_logs_max":"10","npm_config_always_auth":"","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.sLVgtsWI6z/Listeners","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","npm_execpath":"/usr/local/lib/node_modules/npm/bin/npm-cli.js","npm_config_global_style":"","npm_config_cache_lock_retries":"10","npm_package_dependencies_firebase_functions":"^3.3.0","npm_config_update_notifier":"true","npm_config_cafile":"","npm_config_heading":"npm","npm_config_audit_level":"low","npm_config_searchlimit":"20","npm_config_read_only":"","npm_config_offline":"","npm_config_fetch_retry_mintimeout":"10000","npm_config_json":"","npm_config_access":"","npm_config_argv":"{\"remain\":[],\"cooked\":[\"test\"],\"original\":[\"test\"]}","PATH":"/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/yoda/Projects/p0rnhub/service/functions/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin","npm_config_allow_same_version":"","npm_config_https_proxy":"","npm_config_engine_strict":"","npm_config_description":"true","_":"/usr/local/bin/firebase","LaunchInstanceID":"486CA774-9DDE-42B4-A90D-EB3553FE7181","npm_config_userconfig":"/Users/yoda/.npmrc","npm_config_init_module":"/Users/yoda/.npm-init.js","npm_config_cidr":"","PWD":"/Users/yoda/Projects/p0rnhub/service/functions","npm_config_user":"","npm_config_node_version":"12.13.1","npm_lifecycle_event":"test","npm_config_save":"true","npm_config_ignore_prepublish":"","npm_config_editor":"vi","npm_config_auth_type":"legacy","npm_package_name":"functions","npm_config_tag":"latest","npm_config_script_shell":"","npm_config_progress":"true","npm_config_global":"","npm_config_before":"","npm_package_scripts_start":"npm run shell","npm_config_searchstaleness":"900","npm_config_optional":"true","npm_config_ham_it_up":"","XPC_FLAGS":"0x0","npm_config_save_prod":"","npm_config_force":"","npm_config_bin_links":"true","npm_config_searchopts":"","npm_package_engines_node":"8","npm_config_node_gyp":"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js","npm_config_depth":"Infinity","npm_config_sso_poll_frequency":"500","npm_config_rebuild_bundle":"true","npm_package_version":"","XPC_SERVICE_NAME":"0","npm_config_unicode":"true","HOME":"/Users/yoda","SHLVL":"2","npm_config_fetch_retry_maxtimeout":"60000","npm_package_scripts_test":"firebase emulators:exec \"mocha --recursive\"","npm_config_tag_version_prefix":"v","npm_config_strict_ssl":"true","npm_config_sso_type":"oauth","npm_config_scripts_prepend_node_path":"warn-only","npm_config_save_prefix":"^","npm_config_loglevel":"notice","npm_config_ca":"","npm_package_scripts_serve":"firebase serve --only functions","npm_config_save_exact":"","npm_config_group":"20","npm_config_fetch_retry_factor":"10","npm_config_dev":"","npm_package_devDependencies_firebase_functions_test":"^0.1.7","npm_config_version":"","npm_config_prefer_offline":"","npm_config_cache_lock_stale":"60000","npm_package_devDependencies__firebase_testing":"^0.12.3","npm_config_otp":"","npm_config_cache_min":"10","npm_config_searchexclude":"","npm_config_cache":"/Users/yoda/.npm","npm_package_dependencies_base64url":"^3.0.1","npm_package_scripts_logs":"firebase functions:log","LOGNAME":"yoda","npm_lifecycle_script":"firebase emulators:exec \"mocha --recursive\"","npm_config_color":"true","npm_config_proxy":"","npm_config_package_lock":"true","npm_package_dependencies_build_url":"^1.3.3","LC_CTYPE":"UTF-8","npm_config_package_lock_only":"","npm_config_fund":"true","npm_config_save_optional":"","npm_config_ignore_scripts":"","npm_config_user_agent":"npm/6.13.4 node/v12.13.1 darwin x64","npm_config_cache_lock_wait":"10000","npm_config_production":"","npm_config_send_metrics":"","npm_config_save_bundle":"","npm_config_umask":"0022","npm_config_node_options":"","npm_config_init_version":"1.0.0","npm_config_init_author_name":"","npm_config_git":"git","npm_config_scope":"","SECURITYSESSIONID":"186a8","npm_config_unsafe_perm":"true","npm_config_tmp":"/var/folders/h5/x3f6g38d1n5_wd1mrk8_ckm00000gn/T","npm_config_onload_script":"","npm_package_dependencies_firebase_admin":"^8.8.0","npm_node_execpath":"/usr/local/bin/node","npm_config_prefix":"/usr/local","npm_config_link":"","npm_config_format_package_lock":"true","FIRESTORE_EMULATOR_HOST":"localhost:5002","FIREBASE_FIRESTORE_EMULATOR_ADDRESS":"localhost:5002"}
[debug] [2019-12-25T04:29:22.263Z] [worker-~diagnostic~-8c5a2752-d4c3-408b-b55c-df1aba3f5987]: exited
[debug] [2019-12-25T04:29:22.263Z] [worker-~diagnostic~-8c5a2752-d4c3-408b-b55c-df1aba3f5987]: FINISHED
[debug] [2019-12-25T04:29:23.385Z] Dec 25, 2019 11:29:23 AM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
[debug] [2019-12-25T04:29:24.429Z] Dec 25, 2019 11:29:24 AM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
[warn] ⚠ Script exited unsuccessfully (code 4)
[info] i Shutting down emulators.
[info] i Stopping functions emulator
[info] i Stopping firestore emulator
[debug] [2019-12-25T04:29:34.479Z] *** shutting down gRPC server since JVM is shutting down
[debug] [2019-12-25T04:29:34.482Z] *** server shut down
[info] i Stopping hosting emulator
[error]
[error] Error: Script "mocha --recursive" exited with code 4
Here's how I setup each Firestore unit test:
const assert = require("assert")
const firebase = require("#firebase/testing")
const { SampleRepository } = require("./SampleRepository")
const projectId = "a-project-id"
const app = firebase.initializeAdminApp({ projectId })
describe("SampleRepository", () => {
var db
var repository
before(async () => {
db = app.firestore()
repository = new SampleRepository(db)
})
afterEach(async () => {
await firebase.clearFirestoreData({ projectId })
})
after(async () => {
await db.terminate()
})
describe("firstMethod", () => {
it("use case 1", async () => {
// Do some testing here.
})
it("use case 2", async () => {
// Do some testing here.
})
})
describe("secondMethod", () => {
it("use case 1", async () => {
// Do some testing here.
})
})
})
I setup the npm test command to invoke this: firebase emulators:exec \"mocha --recursive\".
At this point, I am pretty clueless what causes this but I suspect it's a problem in the Firestore emulator or something? And I don't know what code 4 means in: Script exited unsuccessfully (code 4).
Any help is appreciated.
UPDATE 1: Now I know what the code 4 means. It means that I have 4 failing tests.

Resources