Why Botium CLI fails extracting utterances data from DialogFlow agent? - dialogflow-es

After setting up Botium and connecting it to my DialogFlow agent (with a DialogFlow Admin Service Account on Google Cloud Platform), I tried to extract the data (intents and utterances) from DialogFlow automatically with the command botium-cli nlpextract. This is the error I got:
user#ubuntu20:~/workspace$ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/google_key.json"
user#ubuntu20:~/workspace$ botium-cli nlpextract --config botium.json --convos dataset_botium --verbose
botium-cli Using Botium configuration file botium.json +0ms
botium-cli-nlp command options: { _: [ 'nlpextract' ],
botium-cli-nlp config: 'botium.json',
botium-cli-nlp c: 'botium.json',
botium-cli-nlp convos: [ 'dataset_botium' ],
botium-cli-nlp C: [ 'dataset_botium' ],
botium-cli-nlp verbose: true,
botium-cli-nlp v: true,
botium-cli-nlp '$0': '/usr/local/bin/botium-cli' } +0ms
(...)
botium-connector-PluginConnectorContainer-helper Botium plugin loaded from /usr/local/lib/node_modules/botium-cli/node_modules/botium-connector-dialogflow/index.js +0ms
botium-connector-dialogflow Validate called +0ms
botium-connector-BaseContainer _RunCustomHook onBuild finished +0ms
botium-connector-dialogflow Build called +1ms
botium-connector-dialogflow-nlp Dialogflow agent: {
botium-connector-dialogflow-nlp "parent": ####,
botium-connector-dialogflow-nlp "displayName": ####,
botium-connector-dialogflow-nlp "defaultLanguageCode": "it",
botium-connector-dialogflow-nlp "timeZone": "Europe/Kaliningrad",
botium-connector-dialogflow-nlp "enableLogging": true,
botium-connector-dialogflow-nlp "matchMode": "MATCH_MODE_HYBRID",
botium-connector-dialogflow-nlp "classificationThreshold": 0.30000001192092896,
botium-connector-dialogflow-nlp "apiVersion": "API_VERSION_V2",
botium-connector-dialogflow-nlp "tier": "TIER_STANDARD"
botium-connector-dialogflow-nlp } +0ms
botium-connector-dialogflow-nlp Utterances files not found for Default Fallback Intent, checking for utterances in intents/Default Fallback Intent_usersays_en-us.json and intents/Default Fallback Intent_usersays_it.json. Ignoring intent. +20ms
botium-connector-dialogflow Clean called +2s
botium-connector-BaseContainer _RunCustomHook onClean finished +2s
botium-connector-BaseContainer Cleanup rimrafing temp dir /home/user/workspace/botiumwork/agent-name 20200722 124913 wTImF +0ms
Failed to extract utterances: Cannot read property 'intents' of undefined
I can't find anything online about this. If I download the agent in a zip file, all the 21 intents which I inserted are available, each one with 85 training utterances.
(I am using Ubuntu20 on an Entroware Apollo laptop)

There was a bug in the Botium Dialogflow Connector. It is fixed now and will be included in the next release.
In the meantime, you can replace the latest release of the connector with the latest changes from the Github repository:
npm install codeforequity-at/botium-connector-dialogflow#master

Related

Log all failed attempts in testcafe quarantine mode?

I have quarantine mode enabled in my testcafe configuration.
"ci-e2e": {
"browsers": [
"chrome:headless"
],
"debugOnFail": false,
"src": "./tests/e2e/*.test.ts",
"concurrency": 1,
"quarantineMode": true,
"reporters": [
{
"name": "nunit3",
"output": "results/e2e/testResults.xml"
},
{
"name": "spec"
}
],
"screenshots": {
"takeOnFails": true,
"path": "results/ui/screenshots",
"pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Screenshot-${QUARANTINE_ATTEMPT}.png"
},
"video": {
"path": "results/ui/video",
"failedOnly": true,
"pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Video-${QUARANTINE_ATTEMPT}"
}
},
Now when some attempt fails I have entry in log (nunit xml logfile) with information about failed runs and only one stack-trace. I have screenshot for each failed run.
<failure>
<message>
<![CDATA[ ❌ AssertionError: ... Run 1: Failed Run 2: Failed Run 3: Failed ]]>
</message>
<stack-trace>
here we have stack-trace for only one failed run
</stack-trace>
</failure>
I want to have log entry with stack-trace for each failed run for each failed test. Is it possible to configure testcafe this way? If not what I need to do?
There is a mistake in the config file. The name of the option for reporters should be reporter, but it is reporterS. It means that Testcafe doesn't use these reporters at all and maybe now you just see an outdated file with results.

Prtractor Error with Gitlab CI/CD Pipeline

We have a secured network and Protractor test suite runs locally. But when running the Gitlab CI/CD pipeline with headless chrome it returns network errors
This is my conf.js
exports.config = {
framework : "jasmine2",
multiCapabilities : [
{
browserName: "chrome",
chromeOptions: {
args: [
"--incognito",
"--headless",
"--no-sandbox",
"--disable-gpu",
"--window-size=1920,1080",
"--disable-dev-shm-usage",
"--allow-insecure-localhost"
],
},
},
],
specs: [
'./tests/sample.ts',
],
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar',
seleniumAddress: 'http://localhost:4444/wd/hub',
chromeDriver: './node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_98.0.4758.102',
directConnect: true,
onPrepare: function(){
void browser.manage().timeouts().implicitlyWait(10000);
void browser.waitForAngularEnabled(false);
require("ts-node").register({
project: require("path").join(__dirname, "./tsconfig.json"),
})
},
plugins: [{
package: 'protractor-screenshoter-plugin',
screenshotPath: './outputJS/reports/e2e',
screenshotOnExpect: 'failure+success',
takeScreenshots:'true',
withLogs: 'true',
writeReportFreq: 'asap',
imageToAscii: 'none',
clearFoldersBeforeTest: true
}]
}
Error appears
$ npm run e2e-headless-run
> e2e#1.0.0 e2e-headless-run /var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e
> node node_modules/protractor/bin/protractor ./headless_conf.js
[09:46:36] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress, seleniumServerJar
[09:46:37] I/launcher - Running 1 instances of WebDriver
[09:46:37] I/direct - Using ChromeDriver directly...
Activated Protractor Screenshoter Plugin, ver. 0.10.3 (c) 2016 - 2022 [object Object] and contributors
Started
Creating reporter at ./outputJS/reports/e2e/
FF
Failures:
1) Google Sample Test loading web page
Message:
Expected '**Network Error**' to contain 'PCO'.
Stack:
Error: Failed expectation
at helper.verifyPageTitle (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/helper/helper.ts:151:36)
at loginPage.verify_page_title (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/pages/loginpage.ts:55:23)
I tried adding webDriverProxy and proxy. But same result appears.

Can't deploy Angular Universal to Firebase Functions

Whenever I try to deploy my Angular Universal app, the hosting gets deployed without issue, but I'm faced with the following error whenever I run ng deploy:
Functions did not deploy properly.
Everything functions without error when I run npm run build:ssr though, so I'm not sure what is causing this error. Here is my firebase.json file:
{
"hosting": [
{
"target": "iquench-website",
"public": "dist\\dist\\browser",
"ignore": [
"**/.*"
],
"headers": [
{
"source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
"headers": [
{
"key": "Cache-Control",
"value": "public,max-age=31536000,immutable"
}
]
}
],
"rewrites": [
{
"source": "**",
"function": "ssr"
}
]
}
],
"functions": {
"source": "dist"
}
}
and my .firebaserc:
{
"projects": {
"default": "PROJECT_NAME"
},
"targets": {
"PROJECT_NAME": {
"hosting": {
"iquench-website": [
"PROJECT_NAME"
]
}
}
}
}
Here are the logs when deploying:
=== Deploying to 'PROJECT_NAME'...
i deploying functions, hosting
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
+ functions: required API cloudfunctions.googleapis.com is enabled
+ functions: required API cloudbuild.googleapis.com is enabled
i functions: preparing dist directory for uploading...
i functions: packaged dist (5.72 MB) for uploading
+ functions: dist folder uploaded successfully
i hosting[PROJECT_NAME]: beginning deploy...
i hosting[PROJECT_NAME]: found 115 files in dist\dist\browser
+ hosting[PROJECT_NAME]: file upload complete
i functions: current functions in project: backupFirestore(us-central1), deleteUser(us-central1), ssr(us-central1)
i functions: uploading functions in project: ssr(us-central1)
i functions: updating Node.js 10 function ssr(us-central1)...
+ scheduler: required API cloudscheduler.googleapis.com is enabled
! functions[ssr(us-central1)]: Deployment error.
Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.
Functions deploy had errors with the following functions:
ssr
To try redeploying those functions, run:
firebase deploy --only "functions:ssr"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Functions did not deploy properly.

Unknown error while debuggin rust application in VS Code

I am trying to debug a fairly large rust project in VS code.
The launch.json has this:
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'rpfm_ui'",
"cargo": {
"args": [
"build",
"--bin=rpfm_ui",
"--package=rpfm_ui"
],
"filter": {
"name": "rpfm_ui",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
But when I try to run the application I get the following
Finished dev [unoptimized + debuginfo] target(s) in 9.53s
Raw artifacts:
{
fileName: 'c:\\Users\\ole_k\\Desktop\\rpfm-master\\target\\debug\\rpfm_ui.exe',
name: 'rpfm_ui',
kind: 'bin'
}
Filtered artifacts:
{
fileName: 'c:\\Users\\ole_k\\Desktop\\rpfm-master\\target\\debug\\rpfm_ui.exe',
name: 'rpfm_ui',
kind: 'bin'
}
configuration: {
type: 'lldb',
request: 'launch',
name: "Debug executable 'rpfm_ui'",
args: [],
cwd: '${workspaceFolder}',
relativePathBase: 'c:\\Users\\ole_k\\Desktop\\rpfm-master',
program: 'c:\\Users\\ole_k\\Desktop\\rpfm-master\\target\\debug\\rpfm_ui.exe',
sourceLanguages: [ 'rust' ]
}
Listening on port 49771
[adapter\src\terminal.rs:99] FreeConsole() = 1
[adapter\src\terminal.rs:100] AttachConsole(pid) = 1
[adapter\src\terminal.rs:104] FreeConsole() = 1
[2020-06-27T20:43:04Z ERROR codelldb::debug_session] process launch failed: unknown error
Debug adapter exit code=0, signal=null.
I have also seen this:
PS C:\Users\ole_k\Desktop\rpfm-master> & 'c:\Users\ole_k.vscode\extensions\vadimcn.vscode-lldb-1.5.3\adapter\codelldb.exe' 'terminal-agent' '--port=49628'
Error: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }
[2020-06-27T20:29:08Z ERROR codelldb::debug_session] process launch failed: unknown error
If I run the application from the terminal inside vs code (cargo run --bin rpfm_ui) it works.
There are some external dependencies which are in folders outside of the root folder.
I can debug other projects in the solution which share a lot of the code, but not the external dependencies.
I can debug other projects.
I am running as administrator.
Any ideas on how to resolve the issue?

Error: Cyclic dependency: "User" with loopback passport example

I'm trying to work with Strongloop loopback and loopback-component-passport but can't quite figure out how to get the relationships between the built in User model, and the loopback-component-passport provided models, to work
It looks like the relationships are provided in the loopback-component-passport/lib/models/*.json files but I get the following error:
Error: Cyclic dependency: "User"
at visit (/work/node/loopback/myapp/node_modules/loopback-boot/node_modules/toposort/index.js:29:13)
at visit (/work/node/loopback/myapp/node_modules/loopback-boot/node_modules/toposort/index.js:43:9)
at toposort (/work/node/loopback/myapp/node_modules/loopback-boot/node_modules/toposort/index.js:22:22)
at module.exports.exports (/work/node/loopback/myapp/node_modules/loopback-boot/node_modules/toposort/index.js:10:10)
at sortByInheritance (/work/node/loopback/myapp/node_modules/loopback-boot/lib/compiler.js:248:21)
at buildAllModelInstructions (/work/node/loopback/myapp/node_modules/loopback-boot/lib/compiler.js:205:10)
at compile (/work/node/loopback/myapp/node_modules/loopback-boot/lib/compiler.js:79:27)
at bootLoopBackApp (/work/node/loopback/myapp/node_modules/loopback-boot/index.js:128:22)
at Object.<anonymous> (/work/node/loopback/myapp/server/server.js:44:1)
at Module._compile (module.js:456:26)
[stu:/work/node/loopback/myapp (master)]$
This is my model-config.json
{
"_meta": {
"sources": [
"loopback/common/models",
"loopback/server/models",
"../common/models",
"./models",
"../node_modules/loopback-component-passport/lib/models"
]
},
"User": {
"dataSource": "db",
"public": true
},
"UserCredential": {
"dataSource": "db",
"public": true
},
"UserIdentity": {
"dataSource": "db",
"public": true
},
"AccessToken": {
"dataSource": "db",
"public": false
},
"ACL": {
"dataSource": "db",
"public": false
},
"RoleMapping": {
"dataSource": "db",
"public": false
},
"Role": {
"dataSource": "db",
"public": false
},
"KnowBit": {
"dataSource": "localpg",
"public": true
}
}
By enabling debug with loopback:boot:compiler
$ DEBUG=loopback:boot:compiler slc run
I'm able to get these logs:
[stu:/work/node/loopback/myapp (master)]$ DEBUG=loopback:boot:compiler slc run
INFO strong-agent API key not found, StrongOps dashboard reporting disabled.
Generate configuration with:
npm install -g strongloop
slc strongops
See http://docs.strongloop.com/strong-agent for more information.
supervisor running without clustering (unsupervised)
loopback:boot:compiler Found model "AccessToken" - ../node_modules/loopback/common/models/access-token.json ../node_modules/loopback/common/models/access-token.js +0ms
loopback:boot:compiler Found model "ACL" - ../node_modules/loopback/common/models/acl.json ../node_modules/loopback/common/models/acl.js +1ms
loopback:boot:compiler Found model "Application" - ../node_modules/loopback/common/models/application.json ../node_modules/loopback/common/models/application.js +0ms
loopback:boot:compiler Found model "Change" - ../node_modules/loopback/common/models/change.json ../node_modules/loopback/common/models/change.js +1ms
loopback:boot:compiler Found model "Checkpoint" - ../node_modules/loopback/common/models/checkpoint.json ../node_modules/loopback/common/models/checkpoint.js +0ms
loopback:boot:compiler Found model "Email" - ../node_modules/loopback/common/models/email.json ../node_modules/loopback/common/models/email.js +0ms
loopback:boot:compiler Found model "RoleMapping" - ../node_modules/loopback/common/models/role-mapping.json ../node_modules/loopback/common/models/role-mapping.js +0ms
loopback:boot:compiler Found model "Role" - ../node_modules/loopback/common/models/role.json ../node_modules/loopback/common/models/role.js +1ms
loopback:boot:compiler Found model "Scope" - ../node_modules/loopback/common/models/scope.json ../node_modules/loopback/common/models/scope.js +0ms
loopback:boot:compiler Found model "User" - ../node_modules/loopback/common/models/user.json ../node_modules/loopback/common/models/user.js +0ms
loopback:boot:compiler Skipping unknown module source dir "loopback/server/models" +0ms
loopback:boot:compiler Found model "KnowBit" - ../common/models/know-bit.json ../common/models/know-bit.js +1ms
loopback:boot:compiler Model source code not found: undefined - TypeError: Arguments to path.join must be strings +0ms
loopback:boot:compiler Found model "User" - ../common/models/user.json (no source file) +0ms
loopback:boot:compiler Skipping unknown module source dir "./models" +0ms
loopback:boot:compiler Found model "ApplicationCredential" - ../node_modules/loopback-component-passport/lib/models/application-credential.json ../node_modules/loopback-component-passport/lib/models/application-credential.js +1ms
loopback:boot:compiler Found model "UserCredential" - ../node_modules/loopback-component-passport/lib/models/user-credential.json ../node_modules/loopback-component-passport/lib/models/user-credential.js +0ms
loopback:boot:compiler Found model "UserIdentity" - ../node_modules/loopback-component-passport/lib/models/user-identity.json ../node_modules/loopback-component-passport/lib/models/user-identity.js +0ms
loopback:boot:compiler Using model "User"
Configuration: {"dataSource":"db","public":true}
Definition {"name":"User","plural":"users","base":"User","relations":{"accessTokens":{"type":"hasMany","model":"AccessToken","foreignKey":"userId"},"identities":{"type":"hasMany","model":"UserIdentity","foreignKey":"userId"},"credentials":{"type":"hasMany","model":"UserCredential","foreignKey":"userId"}},"validations":[],"acls":[],"methods":[]} +0ms
loopback:boot:compiler Using model "UserCredential"
Configuration: {"dataSource":"db","public":true}
Definition {"name":"UserCredential","base":"PersistedModel","properties":{"provider":{"type":"String","comments":"facebook, google, twitter, linkedin"},"authScheme":{"type":"String","comments":"oAuth, oAuth 2.0, OpenID, OpenID Connect"},"externalId":{"type":"String","comments":"The provider specific id"},"profile":{"type":"Object"},"credentials":{"type":"Object"},"created":"Date","modified":"Date","id":{"id":1,"generated":true}},"acls":[{"principalType":"ROLE","principalId":"$everyone","permission":"DENY"},{"principalType":"ROLE","principalId":"$owner","permission":"ALLOW"}],"relations":{"user":{"type":"belongsTo","model":"User","foreignKey":"userId"}}} +1ms
loopback:boot:compiler Using model "UserIdentity"
Configuration: {"dataSource":"db","public":true}
Definition {"name":"UserIdentity","plural":"UserIdentities","base":"PersistedModel","properties":{"provider":{"type":"String","comments":"facebook, google, twitter, linkedin"},"authScheme":{"type":"String","comments":"oAuth, oAuth 2.0, OpenID, OpenID Connect"},"externalId":{"type":"String","comments":"The provider specific id"},"profile":{"type":"Object"},"credentials":{"type":"Object"},"created":"Date","modified":"Date","id":{"id":1,"generated":true}},"acls":[{"principalType":"ROLE","principalId":"$everyone","permission":"DENY"},{"principalType":"ROLE","principalId":"$owner","permission":"ALLOW"}],"relations":{"user":{"type":"belongsTo","model":"User","foreignKey":"userId"}}} +0ms
loopback:boot:compiler Using model "AccessToken"
Configuration: {"dataSource":"db","public":false}
Definition {"name":"AccessToken","properties":{"id":{"type":"string","id":true},"ttl":{"type":"number","ttl":true,"default":1209600,"description":"time to live in seconds (2 weeks by default)"},"created":{"type":"Date"}},"relations":{"user":{"type":"belongsTo","model":"User","foreignKey":"userId"}},"acls":[{"principalType":"ROLE","principalId":"$everyone","permission":"DENY"},{"principalType":"ROLE","principalId":"$everyone","property":"create","permission":"ALLOW"}]} +0ms
loopback:boot:compiler Using model "ACL"
Configuration: {"dataSource":"db","public":false}
Definition {"name":"ACL","properties":{"model":{"type":"string","description":"The name of the model"},"property":{"type":"string","description":"The name of the property, method, scope, or relation"},"accessType":"string","permission":"string","principalType":"string","principalId":"string","id":{"id":1,"generated":true}}} +0ms
loopback:boot:compiler Using model "RoleMapping"
Configuration: {"dataSource":"db","public":false}
Definition {"name":"RoleMapping","description":"Map principals to roles","properties":{"id":{"type":"string","id":true,"generated":true},"principalType":{"type":"string","description":"The principal type, such as user, application, or role"},"principalId":"string"},"relations":{"role":{"type":"belongsTo","model":"Role","foreignKey":"roleId"}}} +0ms
loopback:boot:compiler Using model "Role"
Configuration: {"dataSource":"db","public":false}
Definition {"name":"Role","properties":{"id":{"type":"string","id":true,"generated":true},"name":{"type":"string","required":true},"description":"string","created":"date","modified":"date"},"relations":{"principals":{"type":"hasMany","model":"RoleMapping","foreignKey":"roleId"}}} +0ms
loopback:boot:compiler Using model "KnowBit"
Configuration: {"dataSource":"localpg","public":true}
Definition {"name":"KnowBit","base":"PersistedModel","idInjection":true,"properties":{"label":{"type":"string","required":true},"link":{"type":"string","required":true}},"validations":[],"relations":{},"acls":[],"methods":[]} +0ms
TL;DR
I had specified the same string "User" for the name and base attributes, to fix the problem I changed the name value to lowercase "user"
Full story
ok so when I copied the
loopback-example-passport/common/models/user.json
file I mistyped and set the name='User' instead of 'user'
This did not fix the ultimate problem, but I think it explains the Cyclic dependency. The 'base' is the 'base' class of this model and I had that set to 'User' as well
This allows me to get past the model compilation stage but still leaves me without a configured relationship from 'user' to 'UserIdentity' which the passport code requires.
I think I'm on the right track though, the insight being that the loopback models in the strongloop/loopback-example-passport example are Overriding the built in classes with new model classes where the first letter of the class name is lower cased for example userCredential is the override for the built in model class UserCredential and so on, this is a bit confusing at first
{
"name": "userCredential",
"plural": "userCredentials",
"base": "UserCredential",
...
But I think if I go through and check that I'm using the lower case versions things might work out
This was indeed the problem

Resources