How can I configure develco meter setting? - embedded

I am getting these log messages as unable to configure develco settings:
Zigbee2MQTT:error 2022-03-23 07:48:47: Failed to configure '0x0015bc001902abd3', attempt 1 (Error: ConfigureReporting 0x0015bc001902abd3/1 genOnOff([{"attribute":"onOff","minimumReportInterval":0,"maximumReportInterval":3600,"reportableChange":0}], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 6306 - 1 - 3 - 6 - 7 after 10000ms)
at Timeout._onTimeout (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/utils/waitress.ts:64:35)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7))

Related

ZooKeeper gives exiting JVM with error code 2 error

I have openjdk16.0.1, zookeper and kafka in my machine.
When I use the command "zkServer.cmd start" it gives me the error below.
ERROR [main:QuorumPeerMain#99] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing C:\Users\****\Desktop\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.base/java.util.Properties.loadConvert(Properties.java:672)
at java.base/java.util.Properties.load0(Properties.java:456)
at java.base/java.util.Properties.load(Properties.java:408)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:185)
... 2 more
Invalid config, exiting abnormally
2021-04-30 17:25:17,422 [myid:] - INFO [main:ZKAuditProvider#42] - ZooKeeper audit is disabled.
2021-04-30 17:25:17,428 [myid:] - ERROR [main:ServiceUtils#42] - Exiting JVM with code 2
Is there any solution for this?
tickTime=2000
initLimit=10
syncLimit=5
dataDir=C:\Users\myUserName\Desktop\apache-zookeeper-3.7.0-bin\data clientPort=2181
Now I changed the place of the zookeper folder. it is now under C:
dataDir=C:\apache-zookeeper-3.7.0-bin\data
However, there is still and error. This time:
ERROR [main:ZooKeeperServerMain#70] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\apache-zookeeper-3.7.0-bin\bin\..\conf\zoo.cfg"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:660)
at java.base/java.lang.Integer.parseInt(Integer.java:778)
at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:78)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:110)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:68)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:141)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)

Does karate support headless testing in CI environment (gitlab CI)

We have done UI automation using karate framework. But I am facing challenges while trying to run the tests using gitlab pipeline.
I am using gradle build tool and added a simple step in the gitlab-ci.yaml, but the build fails every time. Here is what I tried:
Added this in feature file:
* configure driver = { type: 'chrome', headless: true }
Got the error:
18:10:39.056 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {}->http://localhost:9222
18:10:39.056 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to localhost/127.0.0.1:9222
18:10:39.056 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-8: Shutdown connection
18:10:39.056 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
18:10:39.057 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 8][route: {}->http://localhost:9222][total available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
18:10:39.057 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 1 milliseconds for URL: http://localhost:9222
Also, tried by adding chromedriver: * configure driver = { type: 'chromedriver', port: 9515, executable: 'chromedriver' }. Got this error:
18:19:01.541 [ForkJoinPool-1-worker-1] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {}->http://localhost:9515][total available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
18:19:01.542 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 19 milliseconds for URL: http://localhost:9515/session
18:19:01.542 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
I want to execute the tests on a particular environment when pipeline runs but nothing is working as of now.
We can add the code to install chrome and chrome driver in before_script in .gitlab-ci.yml to solve the issue mentioned.
before_script:
- apt-get update && apt-get install -y --no-install-recommends google-chrome-stable
- wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- mv chromedriver /usr/bin/chromedriver
- chown root:root /usr/bin/chromedriver
- chmod +x /usr/bin/chromedriver
UI and CI is not easy, we have documented how to use the karate-chrome container: https://github.com/intuit/karate/tree/master/karate-core#karate-chrome
And others have had success with SaaS providers: https://stackoverflow.com/a/60992292/143475
If you are trying another route, you may need to do some research / digging. And please contribute your findings back to the community.

CypressError: `cy.visit()` failed trying to load: https://dev-eccc.env.xxxx.com/ via Gitlab CI job

I have setup a Gitlab ci/cd job to execute all cypress integration tests. I found that all tests are getting fail due to home URL is getting failed to load by cy.visit().
On my local machine it is working fine.
below is the complete Error trace:
CypressError: `cy.visit()` failed trying to load:
https://dev-eccc.env.ihsmarkit.com/
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: getaddrinfo ENOTFOUND dev-eccc.env.ihsmarkit.com
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `Facility Register`
at http://localhost:45271/__cypress/runner/cypress_runner.js:156433:23
at visitFailedByErr (http://localhost:45271/__cypress/runner/cypress_runner.js:155794:12)
at http://localhost:45271/__cypress/runner/cypress_runner.js:156432:11
at tryCatcher (http://localhost:45271/__cypress/runner/cypress_runner.js:10130:23)
at Promise._settlePromiseFromHandler (http://localhost:45271/__cypress/runner/cypress_runner.js:8065:31)
at Promise._settlePromise (http://localhost:45271/__cypress/runner/cypress_runner.js:8122:18)
at Promise._settlePromise0 (http://localhost:45271/__cypress/runner/cypress_runner.js:8167:10)
at Promise._settlePromises (http://localhost:45271/__cypress/runner/cypress_runner.js:8243:18)
at _drainQueueStep (http://localhost:45271/__cypress/runner/cypress_runner.js:4837:12)
at _drainQueue (http://localhost:45271/__cypress/runner/cypress_runner.js:4830:9)
at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues
(http://localhost:45271/__cypress/runner/cypress_runner.js:4846:5)
at Async.drainQueues (http://localhost:45271/__cypress/runner/cypress_runner.js:4716:14)
From Your Spec Code:
at Object.homepage_test (http://localhost:45271/__cypress/tests?p=cypress/integration/eccc-
app-ui-cypress/API/register_api.ts:71:8)
at Context.eval (http://localhost:45271/__cypress/tests?p=cypress/integration/eccc-app-ui-
cypress/API/register_api.ts:13:25)
From Node.js Internals:
Error: getaddrinfo ENOTFOUND dev-eccc.env.ihsmarkit.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)

Karate: How to implement --no-sandbox header for linux usage with sudo

I want to setup a headless chrome driver for UI Test Automation in jenkins.
But to run the test command
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
I have to run as root and it requires --no-sandbox, which, if I'm not wrong, it's still not supported in v0.9.3.
If possible, how can I include --no-sandbox option?
I checked https://intuit.github.io/karate/karate-core/ and there is no --no-sandbox option.
My feature configuration:
Feature: message end-point
Background:
* configure driver = { type: 'chrome', executable: '/usr/bin/google-chrome', headless: true }
# Login Url
* def browserManagementUrl = 'http://localhost:8000/login/'
Scenario: GUI Testing for Login page
Given driver browserManagementUrl
And eval driver.input('input[name=name]', 'admin')
And eval driver.input('input[name=password]', 'adminadmin')
And driver.submit('#login-button')
When driver.submit('#login-button')
Then match driver.location == 'http://localhost:8000/select/'
The linux command and it's results
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
07:15:56.296 [main] INFO com.intuit.karate.Main - Karate version: 0.9.3
07:15:57.345 [ForkJoinPool-1-worker-1] WARN com.intuit.karate - skipping bootstrap configuration: could not find or read file: classpath:karate-config.js
07:15:57.418 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - command: [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.419 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #0 for port to be ready - localhost:9222
07:15:57.420 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - env PATH: /sbin:/bin:/usr/sbin:/usr/bin
07:15:57.423 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.674 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #1 for port to be ready - localhost:9222
07:15:57.675 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.793 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - [0612/071557.791933:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
07:15:57.810 [chrome_1560323757416] DEBUG c.intuit.karate.shell.CommandThread - command complete, exit code: 1 - [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.926 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #2 for port to be ready - localhost:9222
07:15:57.927 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:58.178 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #3 for port to be ready - localhost:9222
[...]
07:16:02.206 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #19 for port to be ready - localhost:9222
07:16:02.207 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:16:02.848 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - request:
1 > GET http://localhost:9222/json
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Host: localhost:9222
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_212)
07:16:02.862 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 13 milliseconds for URL: http://localhost:9222/json
07:16:02.863 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
07:16:02.918 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 1 of 1: karate_GUI.feature
---------------------------------------------------------
feature: karate_GUI.feature
report: target/karate_GUI.json
scenarios: 1 | passed: 0 | failed: 1 | time: 5.4993
---------------------------------------------------------
Karate version: 0.9.3
======================================================
elapsed: 6.39 | threads: 1 | thread time: 5.50
features: 1 | ignored: 0 | efficiency: 0.86
scenarios: 1 | passed: 0 | failed: 1
======================================================
failed features:
karate_GUI: karate_GUI.feature:8 -
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Exception in thread "main" picocli.CommandLine$ExecutionException: there are test failures
at com.intuit.karate.Main$1.handleExecutionException(Main.java:133)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.Main.main(Main.java:139)
I guess you do know that the UI automation pieces are still experimental and yes I don't think we support --no-sandbox - feel free to open a ticket and help us with some links to why this is needed, what it does etc.
A suggested workaround is you can pass a batch file as the executable key to the configure driver call. In this batch file you can then call the chromedriver executable with whatever custom parameters or arguments you need.
Do let us know if that works. It also sounds to me that a way to pass any custom flags is a needed feature, do add this to your feature request.
EDIT: for those landing here in future, I'm not 100% sure, but maybe the info here will help: https://github.com/intuit/karate/issues/1134#issuecomment-638990087

When karate-config.js fails it prints error for each feature

Karate-Netty version 0.9.2
Whenever my karate-config.js evaluation fails it prints:
16:49:28.753 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
16:49:28.761 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
16:49:28.762 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
<< MY SUPER AMAZING SCRIPT HERE >>
}
Note here I made if fail on purpose with trivial error just to provoke it ^
After the error it would print it for every scenario in every feature file I have, so having 55 feature files with 304 scenarios and karate-config.js with 104 lines you can imagine that this gets bad very fast.
So karate-config 5 lines long with intentional fail + 2 features with single scenario look something like this:
Generating a RSA private key
.+++++++++++++++++++++++++++
...+++++++++++++++++++++++++++
writing new private key to 'key.pem'
-----
17:06:36.217 [main] INFO com.intuit.karate.netty.Main - Karate version: 0.9.2
17:06:36.426 [main] INFO com.intuit.karate.Runner - Karate version: 0.9.2
17:06:37.434 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.435 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
karate.configure('followRedirectss', false);
// imagine having additional ~100 lines here
// and additional 54 features
}
17:06:37.436 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.554 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 1 of 2: src/features/null/null.feature
---------------------------------------------------------
feature: src/features/null/null.feature
report: target/src.features.null.null.json
scenarios: 1 | passed: 0 | failed: 1 | time: 0.0000
---------------------------------------------------------
17:06:37.584 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.585 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
karate.configure('followRedirectss', false);
// imagine having additional ~100 lines here
// and additional 54 features
}
17:06:37.586 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.589 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 2 of 2: src/features/null/null.1.feature
---------------------------------------------------------
feature: src/features/null/null.1.feature
report: target/src.features.null.null.1.json
scenarios: 1 | passed: 0 | failed: 1 | time: 0.0000
---------------------------------------------------------
Karate version: 0.9.2
======================================================
elapsed: 1.16 | threads: 1 | thread time: 0.00
features: 2 | ignored: 0 | efficiency: 0.00
scenarios: 2 | passed: 0 | failed: 2
======================================================
failed features:
src.features.null.null: null.feature:3 - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
src.features.null.null.1: null.1.feature:3 - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
Exception in thread "main" picocli.CommandLine$ExecutionException: there are test failures
at com.intuit.karate.netty.Main$1.handleExecutionException(Main.java:133)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.netty.Main.main(Main.java:139)
Any way to avoid this and to have fail on karate-config.js cause run to stop all together?
As you know karate-config.js is executed before every scenario. A problem with this is considered "catastrophic". Karate is designed to try and move on to the next scenario.
Feel free to open a feature request and even contribute a fix - but my guess is because of the concept of a callSingle() it would be difficult to have the logic in place to do what you are requesting.
My personal opinion is that this behavior is acceptable, if karate-config.js fails - you have to fix it rather quickly. You can always use the JUnit runner or IDE integration to work on one feature and resolve this before moving on to the whole suite.