Rasa chatbot works in 1.10 version but fails in Rasa 2.2 version? - upgrade

I planned to upgrade my Rasa bots for 2.x version. After upgrade bot doesn't work any more.
Here is how it works in 1.10, I choose wrong answer and bot says "wrong asnwer" and moves to question 2.
2021-05-19 09:12:03 DEBUG rasa.core.processor - Received user message '/vaara_vastaus01' with intent '{'name': 'vaara_vastaus01', 'confidence': 1.0}' and entities '[]'
2021-05-19 09:12:03 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 8 events.
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {'prev_action_listen': 1.0, 'intent_aloita': 1.0}, {'prev_utter_ask_kysymys01': 1.0, 'intent_aloita': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_action_listen': 1.0}]
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - There is no memorised next action
2021-05-19 09:12:03 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2021-05-19 09:12:03 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_TEDPolicy
2021-05-19 09:12:03 DEBUG rasa.core.processor - Predicted next action 'utter_vaara_vastaus01' with confidence 0.88.
2021-05-19 09:12:03 DEBUG rasa.core.processor - Action 'utter_vaara_vastaus01' ended with events '[BotUttered('Answer is wrong', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1621415523.6351407)]'.
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - Current tracker state [{}, {'prev_action_listen': 1.0, 'intent_aloita': 1.0}, {'prev_utter_ask_kysymys01': 1.0, 'intent_aloita': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_action_listen': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_utter_vaara_vastaus01': 1.0}]
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - There is no memorised next action
2021-05-19 09:12:03 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'vaara_vastaus01'.
2021-05-19 09:12:03 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2021-05-19 09:12:03 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_TEDPolicy
2021-05-19 09:12:03 DEBUG rasa.core.processor - Predicted next action 'utter_ask_kysymys02' with confidence 0.85.
2021-05-19 09:12:03 DEBUG rasa.core.processor - Action 'utter_ask_kysymys02' ended with events '[BotUttered('Question 2/20 Which of the following numbers is different from the others?', {"elements": null, "quick_replies": null, "buttons": [{"payload": "/vaara_vastaus02", "title": "0,285"}, {"payload": "/oikea_vastaus02", "title": "285/100"}, {"payload": "/vaara_vastaus02", "title": "28,5%"}], "attachment": null, "image": null, "custom": null}, {}, 1621415523.6392612)]'.
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - Current tracker state [{'prev_action_listen': 1.0, 'intent_aloita': 1.0}, {'prev_utter_ask_kysymys01': 1.0, 'intent_aloita': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_action_listen': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_utter_vaara_vastaus01': 1.0}, {'intent_vaara_vastaus01': 1.0, 'prev_utter_ask_kysymys02': 1.0}]
2021-05-19 09:12:03 DEBUG rasa.core.policies.memoization - There is no memorised next action
2021-05-19 09:12:03 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'vaara_vastaus01'.
2021-05-19 09:12:03 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2021-05-19 09:12:03 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_TEDPolicy
2021-05-19 09:12:03 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 0.98.
2021-05-19 09:12:03 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'.
2021-05-19 09:12:03 DEBUG rasa.core.lock_store - Deleted lock for conversation '01880209ad0e42618fe3299cdd2083b1'.
Answer is wrong
? Question 2/20 Which of the following numbers is different from the others? (Use arrow keys)
» 1: 0,285 (/vaara_vastaus02)
2: 285/100 (/oikea_vastaus02)
3: 28,5% (/vaara_vastaus02)
Type out your own message...
But in 2.2 it stops after given wrong answer to question 1. Also I get following error
2021-05-19 09:55:34 WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: '/.config'. Skipping.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Received user message '/vaara_vastaus01' with intent '{'name': 'vaara_vastaus01', 'confidence': 1.0}' and entities '[]'
2021-05-19 09:11:56 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 9 events.
2021-05-19 09:11:56 DEBUG rasa.core.policies.memoization - Current tracker state:
[state 1] user intent: aloita | previous action name: action_listen
[state 2] user intent: aloita | previous action name: utter_ask_kysymys01
[state 3] user intent: vaara_vastaus01 | previous action name: action_listen
2021-05-19 09:11:56 DEBUG rasa.core.policies.memoization - There is no memorised next action
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: aloita | previous action name: action_listen
[state 2] user intent: aloita | previous action name: utter_ask_kysymys01
[state 3] user text: /vaara_vastaus01 | previous action name: action_listen
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: aloita | previous action name: action_listen
[state 2] user intent: aloita | previous action name: utter_ask_kysymys01
[state 3] user intent: vaara_vastaus01 | previous action name: action_listen
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-05-19 09:11:56 DEBUG rasa.core.policies.ensemble - Made prediction using user intent.
2021-05-19 09:11:56 DEBUG rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
2021-05-19 09:11:56 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_RulePolicy.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Predicted next action 'action_default_fallback' with confidence 0.30.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7fb23a686ad0>]'.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Action 'action_default_fallback' ended with events '[<rasa.shared.core.events.UserUtteranceReverted object at 0x7fb23911e850>]'.
2021-05-19 09:11:56 DEBUG rasa.core.policies.memoization - Current tracker state:
[state 1] user intent: aloita | previous action name: action_listen
[state 2] user intent: aloita | previous action name: utter_ask_kysymys01
2021-05-19 09:11:56 DEBUG rasa.core.policies.memoization - There is a memorised next action 'action_listen'
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: aloita | previous action name: action_listen
[state 2] user intent: aloita | previous action name: utter_ask_kysymys01
2021-05-19 09:11:56 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-05-19 09:11:56 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Policy prediction ended with events '[]'.
2021-05-19 09:11:56 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'.
2021-05-19 09:11:56 DEBUG rasa.core.lock_store - Deleted lock for conversation '57c517c99766474f9d7a6786629e2454'.
Your input ->
Here is my config file for 1.1
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 100
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 100
- name: MappingPolicy
- name: "FallbackPolicy"
nlu_threshold: 0.5
core_threshold: 0.3
fallback_action_name: "action_default_fallback"
and here for 2.2
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 100
- name: FallbackClassifier
threshold: 0.3
ambiguity_threshold: 0.1
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # No configuration for policies was provided. The following default policies were used to train your model.
# # If you'd like to customize them, uncomment and adjust the policies.
# # See https://rasa.com/docs/rasa/policies for more information.
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 100
- name: RulePolicy

Got answer from Rasa forum that worked, here it is
First I changed epochs to 300, that helped and bot continued questions, but they were in wrong order. So next I reverted epochs to 100 and changed MemoizationPolicy with AugmentedMemoizationPolicy and bot failed in beginning, again. Then I changed epochs to 300 and kept AugmentedMemoizationPolicy and now bot works like before in 1.10.

Related

How do I modify existing jobs to switch owner?

I installed Rundeck v3.3.5 (on CentOS 7 via RPM) to replace an old Rundeck instance that was decommissioned. I did the export/import of projects (which worked brilliantly) while connected to the new server as the default admin user. The imported jobs run properly on the correct schedule. I subsequently configured the new server to use LDAP authentication and configured ACLs for users/roles. That also works properly.
However, I see an error like this in the service.log:
ERROR services.NotificationService - Error sending notification email to foo#bar.com for Execution 9358 Error executing tag <g:render>: could not initialize proxy [rundeck.Workflow#9468] - no Session
My thought is to switch job owners from admin to a user that exists in LDAP. I mean, I would like to switch job owners regardless, but I'm also hoping it addresses the error.
Is there a way in the web interface or using rd that I can bulk-modify jobs to switch the owner?
It turns out that the error in the log was caused by notification settings in an included job. I didn't realize that notifications were configured on the parameterized shared job definition, but there were; removing the notification settings caused the error to stop being added to /var/log/rundeck/service.log.
To illustrate the problem, here are chunks of YAML I've edited to show just the important parts. Here's the common job:
- description: Do the actual work with arguments passed
group: jobs/common
id: a618ceb6-f966-49cf-96c5-03a0c2efb9d8
name: do_the_work
notification:
onstart:
email:
attachType: file
recipients: ops#company.com
subject: Actual work being started
notifyAvgDurationThreshold: null
options:
- enforced: true
name: do_the_job
required: true
values:
- yes
- no
valuesListDelimiter: ','
- enforced: true
name: fail_a_lot
required: true
values:
- yes
- no
valuesListDelimiter: ','
scheduleEnabled: false
sequence:
commands:
- description: The actual work
script: |-
#!/bin/bash
echo ${RD_OPTION_DO_THE_JOB} ${RD_OPTION_FAIL_A_LOT}
keepgoing: false
strategy: node-first
timeout: '60'
uuid: a618ceb6-f966-49cf-96c5-03a0c2efb9d8
And here's the job that calls it (the one that is scheduled and causes an error to show up in the log when it runs):
- description: Do the job
group: jobs/individual
name: do_the_job
...
notification:
onfailure:
email:
recipients: ops#company.com
subject: '[Rundeck] Failure of ${job.name}'
notifyAvgDurationThreshold: null
...
sequence:
commands:
- description: Call the job that does the work
jobref:
args: -do_the_job yes -fail_a_lot no
group: jobs/common
name: do_the_work
If I remove the notification settings from the common job, the error in the log goes away. I'm not sure if sending notifications from an included job is not supported. It would be useful to me if it was, so I could place notification settings in a single location. However, I can understand why it presents a problem for the scheduler/executor.

No data in the PurchaserInfo object

Here are my logs when after initilizing I print(purchaserInfo.toString())
I think this might be why I am unable to see any products when I try to display them
D/[Purchases] - DEBUG(12538): Debug logging enabled.
D/[Purchases] - DEBUG(12538): SDK Version - 3.2.0
D/[Purchases] - DEBUG(12538): Initial App User ID - null
D/[Purchases] - DEBUG(12538): Identifying App User ID: aswq4Sdfaewradfgasfw
D/[Purchases] - DEBUG(12538): Deleting old synced subscriber attributes that don't belong to aswq4Sdfaewradfgasfw.
D/[Purchases] - DEBUG(12538): App foregrounded
D/[Purchases] - DEBUG(12538): PurchaserInfo cache is stale, updating caches
D/[Purchases] - DEBUG(12538): Offerings cache is stale, updating caches
D/[Purchases] - DEBUG(12538): [QueryPurchases] Skipping updating pending purchase queue since BillingClient is not connected yet
D/[Purchases] - DEBUG(12538): No subscriber attributes to synchronize.
D/[Purchases] - DEBUG(12538): Listener set
D/[Purchases] - DEBUG(12538): Sending latest purchaser info to listener
D/[Purchases] - DEBUG(12538): Starting connection for com.android.billingclient.api.BillingClientImpl#f8168e4
D/[Purchases] - DEBUG(12538): Vending purchaserInfo from cache
D/[Purchases] - DEBUG(12538): Vending purchaserInfo from cache
D/NetworkSecurityConfig(12538): No Network Security Config specified, using platform default
D/[Purchases] - DEBUG(12538): Billing Service Setup finished for com.android.billingclient.api.BillingClientImpl#f8168e4.
D/[Purchases] - DEBUG(12538): [QueryPurchases] Updating pending purchase queue
I/flutter (12538): PurchaserInfo{entitlements: EntitlementInfos{all: {}, active: {}}, latestExpirationDate: null, allExpirationDates: {}, allPurchaseDates: {}, activeSubscriptions: [], allPurchasedProductIdentifiers: [], firstSeen: 2020-07-06T03:12:21.000Z, originalAppUserId: aswq4Sdfaewradfgasfw, requestDate: 2020-07-07T00:29:14.000Z, originalApplicationVersion: null, originalPurchaseDate: null, managementURL: null}
This is running on Android using: purchases_flutter: ^1.1.1

Serverless CloudFormation template error instance of Fn::GetAtt references undefined resource

I'm trying to setup a new repo and I keep getting the error
The CloudFormation template is invalid: Template error: instance of Fn::GetAtt
references undefined resource uatLambdaRole
in my uat stage, however the dev stage with the exact same format works fine.
I have a resource file for each of these environments.
dev
devLambdaRole:
Type: AWS::IAM::Role
Properties:
RoleName: dev-lambda-role # The name of the role to be created in aws
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AWSLambdaFullAccess
#Documentation states the below policy is included automatically when you add VPC configuration but it is currently bugged.
- arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole
uat
uatLambdaRole:
Type: AWS::IAM::Role
Properties:
RoleName: uat-lambda-role # The name of the role to be created in aws
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AWSLambdaFullAccess
#Documentation states the below policy is included automatically when you add VPC configuration but it is currently bugged.
- arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole
In my serverless.yml my role is defined as
role: ${self:custom.stage}LambdaRole
and the stage is set as
custom:
stage: ${opt:stage, self:provider.stage}
Running serverless deploy --stage dev --verbose succeeds, but running serverless deploy --stage uat --verbose fails with the error. Can anyone see what I'm doing wrong? The uat resource was copied directly from the dev one with only the stage name change.
Here is a screenshot of the directory the resource files are in
I had the same issue, eventually I discovered that my SQS queue name wasn't the same in all 3 places. The following 3 places that the SQS name should match are shown below:
...
functions:
mylambda:
handler: sqsHandler.handler
events:
- sqs:
arn:
Fn::GetAtt:
- mySqsName # <= Make sure that these match
- Arn
resources:
Resources:
mySqsName: # <= Make sure that these match
Type: "AWS::SQS::Queue"
Properties:
QueueName: "mySqsName" # <= Make sure that these match
FifoQueue: true
Ended up here with the same error message. My issue ended up being that I got the "resource" and "Resource" keys in serverless.yml backwards.
Correct:
resources: # <-- lowercase "r" first
Resources: # <-- uppercase "R" second
LambdaRole:
Type: AWS::IAM::Role
Properties:
...
🤦‍♂️
I missed copying a key part of my config here, the actual reference to my Resources file
resources:
Resources: ${file(./serverless-resources/${self:provider.stage}-resources.yml)}
The issue was that I had copied this from a guide and had accientally used self:provider.stage rather than self:custom.stage. When I changed this, it could then deploy.
Indentation Issue
In general, when YAML isn't working I start by checking the indentation.
I hit this issue in my case one of my resources was indented too much, therefore, putting the resource in the wrong node/object. The resources should be two indents in as they're in node resources sub-node Resources
For more info on this see yaml docs

Set up monolog to use rollbar with symfony3?

config.yml
handlers:
rollbar:
type: stream
token: '%rollbar.token%'
level: warning
bubble: true
config:
environment: '%rollbar.environment%'
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
There is no activity on rollbar
$this->get('logger')->warning('testing rollbar');
I have tested their own code (using rollbar/rollbar) which works OK (from below instructions)
https://rollbar.com/docs/notifier/rollbar-php/#installation
I've got Rollbar on my own Symfony app, but it looks like you have the type set to just send it to the standard log files.
rollbar:
token: "%rollbar_serverside_token%"
type: "rollbar" ## This enables the Rollbar handler
config:
environment: "%kernel.environment%"
handler: blocking
level: debug
Since I've grouped the Rollbar handler under a 'fingers_crossed' main/default handler, it only throws items to the outside service if an exception occurs.

Retry instruction in salt after fail

I'm using salt for my deployment issues and have the following question.
Is there any mechanism to retry a command?
For instance I have some thing like this:
platform_deps_git:
git.latest:
- name: ...
- rev: master
- target: ...
- user: ...
- identity: ...
But sometimes the network may fail. Is there any way to retry platform_deps_git instruction?
The next version of Salt (2014.7.0) will have an "onfail" requisite. This will allow you to take another action if something fails.
The docs are here:
http://docs.saltstack.com/en/latest/ref/states/requisites.html#onfail
What I do is grep through salt output whenever I run a highstate and if it sees any failures I rerun the highstate.
There's a first-class retry mechanism for states that was added in 2017:
platform_deps_git:
git.latest:
- name: ...
- rev: master
- target: ...
- user: ...
- identity: ...
- retry:
attempts: 5
until: True
interval: 60
splay: 10
The retry option supports a few different options for controlling its behavior.