XCode Bots API configuration edit fails - xcode

I want to change via the XCode Bots API the scheme name of a bot. A request like curl -XPATCH -H 'Content-Type: application/json' -H 'x-xcsclientversion: 8' https://localhost:20343/api/bots/botid123 -d '{"name": "myawesomebot2"}' to change the bot name works. But if I try to change the configuration object with a request body like '{"configuration": {"schemeName": "scheme2"}}' it fails.
How can the scheme name be modified?

I finally got this solved and want to note the pieces necessary to make this work and how I found it.
First, as you already noticed, is the need for -H "x-xcsclientversion: #" (note, 6 worked for me, as discovered through a check of Apple's Javascript that receives the PATCH request)
Second, after watching Xcode Server update a bot through Charles, it was seen that the URL needs the following parameter added, ?overwriteBlueprint=true
Third, it seems that the JSON data, at the topmost level as name:, also requires requiresUpgrade=false and type=1 (I found the tool jq to be invaluable)
Fourth, changes to the sourceBlueprint requires configuration.sourceControlBlueprint.DVTSourceControlWorkspaceBlueprintIdentifierKey to receive a new UUID. Easily generated in bash by uuidgen command.
Fifth, a mostly-full bot description must be sent. I grabbed the bot's JSON definition through Apple's API, then modified it using jq (see above), deleting out unnecessary key/value pairs so as to match Xcode Server's own API calls. The necessary key/value pairs appear to be:
name
type
requiresUpgrade
configuration (modify as necessary, but a full configuration must be sent)
group (leave as-is, but send it back through)
Sixth, backslash-escape all forward-slashes in the JSON payload. I've done this in bash with ESCAPED_JSON=${BOT_CONFIG_JSON//\//\\\/} and I send -d "$ESCAPED_JSON" in the curl command.
As such, the full curl command I'm using becomes:
curl -k --request PATCH -H "Content-Type: application/json" -H "x-xcsclientversion: 6" -d "$ESCAPED_JSON" https://<username>:<password>#<your_server_address>:20343/api/bots/<your_bot_id>?overwriteBlueprint=true
And a full JSON definition (remember, it must have forward slashes escaped before sending) looks like this
<!-- language: lang-json -->
"requiresUpgrade": false,
"configuration": {
"triggers": [
{
"phase": 1,
"scriptBody": "<REDACTED>",
"type": 1,
"name": "Update github Pending",
"conditions": {
"status": 2,
"onSuccess": true,
"onAnalyzerWarnings": true,
"onBuildErrors": true,
"onWarnings": true,
"onFailingTests": true
}
},
{
"phase": 2,
"scriptBody": "<REDACTED>",
"type": 1,
"name": "Upload to Beta",
"conditions": {
"status": 2,
"onSuccess": true,
"onAnalyzerWarnings": true,
"onBuildErrors": false,
"onWarnings": true,
"onFailingTests": false
}
},
{
"phase": 2,
"scriptBody": "<REDACTED>",
"type": 1,
"name": "Update github status",
"conditions": {
"status": 2,
"onSuccess": true,
"onAnalyzerWarnings": true,
"onBuildErrors": false,
"onWarnings": true,
"onFailingTests": false
}
}
],
"performsUpgradeIntegration": true,
"disableAppThinning": true,
"deviceSpecification": {
"filters": [
{
"platform": {
"_id": "3c884e2499df662057e8c64580003419",
"displayName": "iOS",
"_rev": "8-51c114fcfc83ea5f36df66f119b34ec8",
"simulatorIdentifier": "com.apple.platform.iphonesimulator",
"identifier": "com.apple.platform.iphoneos",
"buildNumber": "14C89",
"version": "10.2"
},
"filterType": 3,
"architectureType": 0
}
],
"deviceIdentifiers": [
"6d928bd891b83b4b8592aedb42001a97",
"6d928bd891b83b4b8592aedb4200776c",
"fa737f03db7b6c04d4c7f9507100700f"
]
},
"periodicScheduleInterval": 0,
"schemeName": "<REDACTED>",
"codeCoveragePreference": 2,
"performsTestAction": true,
"scheduleType": 3,
"performsArchiveAction": true,
"builtFromClean": 2,
"buildConfiguration": "Release",
"performsAnalyzeAction": true,
"sourceControlBlueprint": {
"DVTSourceControlWorkspaceBlueprintLocationsKey": {
"A2739AD29C3BCDF8619D0305ACFDD0C22AEBDDB1": {
"DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlLockedRevisionLocation",
"DVTSourceControlLocationRevisionKey": "9d38dc7507f0f6ac17072d721893f0021c5282ed"
},
"51DBFAD1848AC646B864BBBEDC625B8BAB305A76": {
"DVTSourceControlBranchIdentifierKey": "<THE BRANCH TO WATCH>",
"DVTSourceControlBranchOptionsKey": 4,
"DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch"
}
},
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "51DBFAD1848AC646B864BBBEDC625B8BAB305A76",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {},
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": {
"A2739AD29C3BCDF8619D0305ACFDD0C22AEBDDB1": {
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlAuthenticationStrategy"
},
"51DBFAD1848AC646B864BBBEDC625B8BAB305A76": {
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlAuthenticationStrategy"
}
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": {
"A2739AD29C3BCDF8619D0305ACFDD0C22AEBDDB1": 0,
"51DBFAD1848AC646B864BBBEDC625B8BAB305A76": 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey": "<GENERATE A NEW UUID FOR THIS!!!>",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": {
"A2739AD29C3BCDF8619D0305ACFDD0C22AEBDDB1": "<REDACTED PATH 1>",
"51DBFAD1848AC646B864BBBEDC625B8BAB305A76": "<REDACTED PATH 2>"
},
"DVTSourceControlWorkspaceBlueprintNameKey": "Cool Blueprint",
"DVTSourceControlWorkspaceBlueprintVersion": 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "<REDACTED>.xcworkspace",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git#github.com:<REDACTED REPO 1>",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A2739AD29C3BCDF8619D0305ACFDD0C22AEBDDB1"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git#github.com:<REDACTED REPO 2>",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "51DBFAD1848AC646B864BBBEDC625B8BAB305A76"
}
]
},
"exportsProductFromArchive": true,
"weeklyScheduleDay": 0,
"minutesAfterHourToIntegrate": 0,
"testingDestinationType": 0,
"hourOfIntegration": 0,
"testingDeviceIDs": []
},
"group": {
"name": "41A62776-A72E-44C0-BFF0-D91F699BBA6A"
},
"type": 1,
"name": "My Cool Integration Bot"
I hope this helps.

Related

Parse.Query.Exclude() function not excluding the given values

I am trying to write cloud code that excludes certain values from a query. I have tried using both select() and exclude() to limit what values come back in a query. Here is what my code looks like
Parse.Cloud.beforeFind(Parse.User, (request) => {
return request.query.select('email');
});
For reference, here is the curl command that I am using to test my cloud code:
curl --location --request GET 'https://<parse-server>.b4a.io/parse/users' \
--header 'X-Parse-Application-Id: <app-id>' \
--header 'X-Parse-REST-API-Key: <api-key>' \
--header 'X-Parse-Session-Token: <token>'
In theory, the response to this command should look something like this:
{
results:[{'email':'123#example.com'},{'email':'456#example.com'}']
}
Instead what I get is the following(all of the user information I would normally get if I did nothing):
{
"results": [
{
"objectId": "jKXYLgeB6x",
"username": "cperryoh",
"email": "123#example.com",
"isBanned": false,
"emailVerified": true,
"createdAt": "2022-07-25T17:09:37.963Z",
"updatedAt": "2022-07-27T16:34:54.186Z",
"chunksOwned": {
"__type": "Relation",
"className": "chunk"
},
"ACL": {
"jKXYLgeB6x": {
"read": true,
"write": true
},
"*": {
"read": true
}
}
},
{
"objectId": "ykJJhvNuPh",
"username": "testUser",
"email":"456#example.com"
"isBanned": false,
"emailVerified": true,
"createdAt": "2022-07-25T19:39:02.854Z",
"updatedAt": "2022-07-27T16:20:48.083Z",
"chunksOwned": {
"__type": "Relation",
"className": "chunk"
},
"ACL": {
"*": {
"read": true
},
"ykJJhvNuPh": {
"read": true,
"write": true
}
}
}
]
}
To further add to the confusion, in the cloud-code/parse-SDK documentation, there is no reference to the beforeFind trigger. So I am not even sure what the return type of lambda/function is supposed to be. The only thing I have that is telling me I can return a query object is an example in the cloud code guide here. In one of the examples, they return the result of Parse.Query.or() which does return an object of type Query. Am I using .select() incorrectly or is it not meant for what I am trying to do? Thanks for the help!
Try just:
Parse.Cloud.beforeFind(Parse.User, (request) => {
request.query.select('email');
});

Ansible AXW ignores extra_vars

I want to launch a Job-Template via the AWX-API including some extra_vars, but every response I get has an empty extra_vars field. I already checked the documentation about it:
https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html#extra-variables
which states, that you have to set ask_variables_on_launch: true and/or have corresponding variables in a survey. My Request checks both of these conditions:
Request
POST: https://my.awx.host/api/v2/job_templates/7/launch/
Body
{
"can_start_without_user_input": false,
"passwords_needed_to_start": [],
"ask_scm_branch_on_launch": false,
"ask_variables_on_launch": true,
"ask_tags_on_launch": false,
"ask_diff_mode_on_launch": false,
"ask_skip_tags_on_launch": false,
"ask_job_type_on_launch": false,
"ask_limit_on_launch": false,
"ask_verbosity_on_launch": false,
"ask_inventory_on_launch": false,
"ask_credential_on_launch": false,
"survey_enabled": true,
"variables_needed_to_start": [
"application_server_name",
"server_location",
"application_server_type",
"ssh_keys"
],
"credential_needed_to_start": false,
"inventory_needed_to_start": false,
"job_template_data": {
"name": "template name ",
"id": 7,
"description": ""
},
"defaults": {
"extra_vars": {
"application_server_name": "some name",
"server_location": "some location",
"application_server_type": "some type",
"ssh_keys": [
{
"name": "key1"
},
{
"name": "key2"
},
{
"name": "key3"
}
]
},
"diff_mode": false,
"limit": "",
"job_tags": "",
"skip_tags": "",
"job_type": "run",
"verbosity": 2,
"inventory": {
"name": "AWX Tower (Localhost) my.awx.host",
"id": 1
},
"credentials": [
{
...
}
],
"scm_branch": ""
}}
Response
{
"variables_needed_to_start": [
"'application_server_name' value missing",
"'server_location' value missing",
"'application_server_type' value missing",
"'ssh_keys' value missing"
]}
I'm kinda confused, since I did everything according to the documentation. The values needed by the survey are even in the same Request Body. Could someone help with this problem?
I'm using AWX 16.0.0
Ansible Version 2.9.15
Thanks
So actually, you have to send just the extra vars, not the whole response + vars you get from the AWX. I don't know, if I didn't see this in the docs, or if it's just plain obvious and I did't get it.
ask_variables_on_launch still has to be true!

Magento 2 Klarna checkout

I need to integrate the Klarna Checkout module into magento 2.1.2. I am using the version of the "klarna/m2-checkout module": 4.2.2.
When choosing a delivery method, I always get an error in the pop-up window:
Sorry, the delivery option you chose cannot be processed. Please select another delivery option.
When i choose shipping method, i get this responce:
{
"shared": {
"customer": {
"type": "person"
},
"user_preferences": {
"remember_me": true
},
"language": "en",
"locale": "en-US",
"customer_details": {
"client_token": "eyJhbGciOiJSUzUxMiJ9.eyJz",
"country": "swe",
"completed": true,
"fields_with_obfuscation": {
"email": "melosicuva#royalhost.info",
"given_name": "Testperson-se",
"family_name": "Approved",
"street_address": "Stårgatan 1",
"postal_code": "123 45",
"city": "Ankeborg",
"country": "SE",
"phone": "076-526 00 00",
"date_of_birth": "1941-03-21",
"national_identification_number": "19410321-9202"
},
"reference": "2f9a445a57a49215175178099002fc7165ee"
},
"shipping_details": {
"client_token": "eyJhbGciOiJSUzUxMiJ9.eyJzZXNzaW9uX"
},
"currency": "SEK",
"obfuscated_fields": []
},
"cart": {
"total_tax_amount": 30000,
"total_price_including_tax": 150000,
"total_price_excluding_tax": 120000,
"total_shipping_amount_excluding_tax": 0,
"total_surcharge_amount_excluding_tax": 0,
"total_discount_amount_excluding_tax": 0,
"total_shipping_amount_including_tax": 0,
"total_surcharge_amount_including_tax": 0,
"total_discount_amount_including_tax": 0,
"subtotal": 120000,
"total_store_credit": 0,
"items": [{
"type": "physical",
"reference": "1201018390010",
"name": "Armour Bib Shorts",
"quantity": 1,
"unit_price": 150000,
"total_tax_amount": 30000,
"tax_rate": 2500,
"total_price_including_tax": 150000,
"total_price_excluding_tax": 120000,
"product_url": "https://local.com/armour-bib-shorts-black.html?___store%5B_data%5D%5Bstore_id%5D=2&___store%5B_data%5D%5Bcode%5D=se&___store%5B_data%5D%5Bwebsite_id%5D=2&___store%5B_data%5D%5Bgroup_id%5D=2&___store%5B_data%5D%5Bname%5D=Sweden+Store&___store%5B_data%5D%5Bsort_order%5D=30&___store%5B_data%5D%5Bis_active%5D=1&___store%5B_data%5D%5Balias%5D=Sweden&___store%5B_data%5D%5Bavailable_currency_codes%5D%5B0%5D=SEK",
"image_url": "https://local.com//media/catalog/product/a/r/armour-bib-shorts-aw18-01.jpg"
}]
},
"errors": {
"generic": ["shipping_service_failed"]
},
"options": {
"allow_separate_shipping_address": false,
"date_of_birth_mandatory": false,
"title_mandatory": false,
"national_identification_number_mandatory": false,
"phone_mandatory": true,
"allowed_customer_types": ["person"],
"payment_selector_on_load": false
},
"preview_payment_methods": [{
"id": "-1",
"type": "invoice",
"locked": false,
"selected": false,
"data": {
"days": 14
}
}, {
"id": "-1",
"type": "direct_debit",
"locked": false,
"selected": false
}, {
"id": "-1",
"type": "credit_card",
"locked": false,
"selected": false,
"data": {
"available_cards": ["VISA", "MASTER"],
"allow_saved_card": false,
"do_save_card": false,
"collect_consent": false,
"consent_given": false
}
}],
"allowed_billing_countries": ["swe"],
"status": {
"prescreened": false
},
"analytics_user_id": "ELmpDn1f600JYxHtagC7FcsOdAXe9-2iwWhIzHSfmhM=",
"merchant": {
"hashed_id": "a9c814c7a780d46a7fb2403e452829b3",
"name": "Your business name"
},
"merchant_urls": {
"checkout": "https://local.com/checkout/klarna",
"confirmation": "https://checkout-eu.playground.klarna.com/yaco/orders/ffc4101d-00cb-5e63-81fc-0f0c15baeac3/redirect?auth_token=0el7mltb89prfz2fz2mw",
"terms": "https://local.com/terms",
"confirmation_page": "https://local.com/checkout/klarna/confirmation/id/ffc4101d-00cb-5e63-81fc-0f0c15baeac3"
}
}
Here I do not like the block:
"errors": {
"generic": ["shipping_service_failed"]
}
Does anyone know how to fix it?
Delivery error :
This error occurs when you set address_update callback and and it's not handled in the right way. This callback should be set if you need to update order's addresses, and should not take more than 10 sec.
Here's an example: https://developers.klarna.com/api/#checkout-api-callbacks-address-update
And some best practices: https://developers.klarna.com/documentation/klarna-checkout/best-practices/#address-updated
If you run Klarna Checkout on localhost, then you should make the localhost-based application reachable from Klarna via the HTTP protocol (e.g., for the address_update callback).
You can do it via services like Ngrok.
In case of this error it's good to know that:
Klarna Checkout is calling callbacks regarding the shipping on checkout page:
address_update
shipping_option_update
If Klarna doesn't receive the answer from callback request in 10s it will end the connection and eventually you will see the error message. You can find access status logs in your http server, for example access status 499 in nginx. On the other hand in Klarna Merchant Portal you will see logs with status "???".
The callback request may be not accessible or not accessible in time below 10s:
if you work on localhost configure tunnel to expose your local environment to be visible by Klarna. For example with ngrok.
make sure that magento cache is enabled.
disable xdebug (unless it's version >=3)
check internet connection quality
check php.ini and http server performance related settings
If error still occurs you can debug the callback api to find the bottleneck. For example you can use logs in Klarna Merchant Portal to create a postman request to the callback api.

Attempt to index document gives error: "only value lists are allowed in serialized settings"

When attempting to index the following document:
{
"branch": "master",
"classes": [
{
"content_count": 2,
"documentation": "",
"extends": [],
"generic": "",
"implements": [],
"line": 10,
"line_count": 36,
"modifiers": [
"public"
],
"name": "removeDuplicateFromString"
}
],
"commit_hash": "e53249ba2381d2f20f3d4493ad70e2da0abb3b05",
"contributors": [
{
"id": "7676016",
"name": "varunu28",
"url": "https://github.com/varunu28"
}
],
"enums": [],
"fields": [],
"filename": "removeDuplicateFromString.java",
"imports": [
{
"name": "java.io.BufferedReader",
"wildcard": false
},
{
"name": "java.io.InputStreamReader",
"wildcard": false
}
],
"interfaces": [],
"license": "",
"methods": [
{
"cyclomatic_complexity": 1,
"documentation": "",
"generic": "",
"line": 11,
"line_count": 9,
"modifiers": [
"public",
"static"
],
"name": "main",
"params": [
{
"name": "args",
"type": "String[]"
}
],
"parent": "removeDuplicateFromString",
"type_": "void"
},
{
"cyclomatic_complexity": 5,
"documentation": "",
"generic": "",
"line": 29,
"line_count": 16,
"modifiers": [
"public",
"static"
],
"name": "removeDuplicate",
"params": [
{
"name": "s",
"type": "String"
}
],
"parent": "removeDuplicateFromString",
"type_": "String"
}
],
"number_forks": 1695,
"number_stars": 4000,
"number_watchs": 394,
"package": "",
"path": "Others",
"repository": "TheAlgorithms/Java"
}
I get the following error:
{"error":{"root_cause":[{"type":"settings_exception","reason":"Failed to load settings from [{\"interfaces\":[],\"imports\":[{\"name\":\"java.io.BufferedReader\",\"wildcard\":false},{\"name\":\"java.io.InputStreamReader\",\"wildcard\":false}],\"package\":\"\",\"methods\":[{\"parent\":\"removeDuplicateFromString\",\"line_count\":9,\"line\":11,\"documentation\":\"\",\"name\":\"main\",\"cyclomatic_complexity\":1,\"modifiers\":[\"public\",\"static\"],\"params\":[{\"name\":\"args\",\"type\":\"String[]\"}],\"type_\":\"void\",\"generic\":\"\"},{\"parent\":\"removeDuplicateFromString\",\"line_count\":16,\"line\":29,\"documentation\":\"\",\"name\":\"removeDuplicate\",\"cyclomatic_complexity\":5,\"modifiers\":[\"public\",\"static\"],\"params\":[{\"name\":\"s\",\"type\":\"String\"}],\"type_\":\"String\",\"generic\":\"\"}],\"number_forks\":1695,\"classes\":[{\"implements\":[],\"line_count\":36,\"extends\":[],\"line\":10,\"documentation\":\"\",\"name\":\"removeDuplicateFromString\",\"content_count\":2,\"modifiers\":[\"public\"],\"generic\":\"\"}],\"repository\":\"TheAlgorithms/Java\",\"branch\":\"master\",\"commit_hash\":\"e53249ba2381d2f20f3d4493ad70e2da0abb3b05\",\"enums\":[],\"path\":\"Others\",\"license\":\"\",\"filename\":\"removeDuplicateFromString.java\",\"number_watchs\":394,\"contributors\":[{\"name\":\"varunu28\",\"id\":\"7676016\",\"url\":\"https://github.com/varunu28\"}],\"fields\":[],\"number_stars\":4000}]"}],"type":"settings_exception","reason":"Failed to load settings from [{\"interfaces\":[],\"imports\":[{\"name\":\"java.io.BufferedReader\",\"wildcard\":false},{\"name\":\"java.io.InputStreamReader\",\"wildcard\":false}],\"package\":\"\",\"methods\":[{\"parent\":\"removeDuplicateFromString\",\"line_count\":9,\"line\":11,\"documentation\":\"\",\"name\":\"main\",\"cyclomatic_complexity\":1,\"modifiers\":[\"public\",\"static\"],\"params\":[{\"name\":\"args\",\"type\":\"String[]\"}],\"type_\":\"void\",\"generic\":\"\"},{\"parent\":\"removeDuplicateFromString\",\"line_count\":16,\"line\":29,\"documentation\":\"\",\"name\":\"removeDuplicate\",\"cyclomatic_complexity\":5,\"modifiers\":[\"public\",\"static\"],\"params\":[{\"name\":\"s\",\"type\":\"String\"}],\"type_\":\"String\",\"generic\":\"\"}],\"number_forks\":1695,\"classes\":[{\"implements\":[],\"line_count\":36,\"extends\":[],\"line\":10,\"documentation\":\"\",\"name\":\"removeDuplicateFromString\",\"content_count\":2,\"modifiers\":[\"public\"],\"generic\":\"\"}],\"repository\":\"TheAlgorithms/Java\",\"branch\":\"master\",\"commit_hash\":\"e53249ba2381d2f20f3d4493ad70e2da0abb3b05\",\"enums\":[],\"path\":\"Others\",\"license\":\"\",\"filename\":\"removeDuplicateFromString.java\",\"number_watchs\":394,\"contributors\":[{\"name\":\"varunu28\",\"id\":\"7676016\",\"url\":\"https://github.com/varunu28\"}],\"fields\":[],\"number_stars\":4000}]","caused_by":{"type":"illegal_state_exception","reason":"only value lists are allowed in serialized settings"}},"status":500}
From which I've gathered that the main issues are either described in the part saying that:
{"type":"illegal_state_exception","reason":"only value lists are allowed in serialized settings"}}
Or:
"error":{"root_cause":[{"type":"settings_exception","reason":"Failed to load settings from [{\"interfaces\":[],\"imports\": ........
But I cannot find any information about this error or what it could be caused by. I've tried indexing both using a predefined index with mappings and to a non-existing index. Nothing seems to work.
Why can't I index this document?
It turns out that, as Farid mentioned in the comments section, I was using the wrong command when indexing from the command line.
The correct command to run is
curl -X POST -H 'Content-Type: application/json' [index location] -d [data]
Where the key is that you use POST and not PUT which is what I was doing.
Adding this for the ones using Kibana Dev Tools.
The key is to use an document type after an index name when adding the document
POST /{index name}/{document type}
{
request body (document) goes here.
}

Rasa nlu tutorial doesn't work

Rasa NLU version (0.11.3):
Used backend / pipeline (spacy_sklearn):
Operating system (osx):
Issue: I tried to follow the tutorial: https://rasahq.github.io/rasa_nlu/tutorial.html?highlight=project#,
Installed spaCy + sklearn
Created config_spacy.json
Downloaded sample file and train
I've test greeting and goodbye intent and they are work
but when I test with command:
curl -X POST localhost:5000/parse -d '{"q":"I am looking for Mexican food"}' | python -m json.tool
it returns:
{
"intent": {
"name": "None",
"confidence": 1.0
},
"entities": [],
"text": "yes"
}
Content of configuration file (if used & relevant):
{
"project": null,
"fixed_model_name": null,
"config": "config.json",
"data": null,
"emulate": null,
"language": "en",
"log_file": null,
"log_level": "INFO",
"mitie_file": "data/total_word_feature_extractor.dat",
"spacy_model_name": null,
"num_threads": 1,
"max_training_processes": 1,
"path": "/rasa_nlu/projects",
"port": 5000,
"token": null,
"cors_origins": [],
"max_number_of_ngrams": 7,
"pipeline": [],
"response_log": "/rasa_nlu/logs",
"storage": null,
"aws_endpoint_url": null,
"duckling_dimensions": null,
"duckling_http_url": null,
"ner_crf": {
"BILOU_flag": true,
"features": [
[
"low",
"title",
"upper",
"pos",
"pos2"
],
[
"bias",
"low",
"word3",
"word2",
"upper",
"title",
"digit",
"pos",
"pos2",
"pattern"
],
[
"low",
"title",
"upper",
"pos",
"pos2"
]
],
"max_iterations": 50,
"L1_c": 1,
"L2_c": 0.001
},
"intent_classifier_sklearn": {
"C": [
1,
2,
5,
10,
20,
100
],
"kernel": "linear"
}
}
Status:
{
"available_projects": {
"default": {
"status": "ready",
"available_models": [
"fallback"
]
}
}
}
In your config file the pipeline is set to [] but needs to be configured properly. The documentation for the pipeline configuration option can be found here. The available options are discussed here.
The pipeline can either be a pre-configured pipeline like: mitie, spacy_sklearn, or keyword. It can also be a custom pipeline like: ["nlp_spacy", "ner_crf", "ner_synonyms"]. I would recommend setting your pipeline to:
pipeline: "space_sklearn"
Update your configuration file and restart the server. If the server is still running in a console window press Ctrl + c to stop it. Then re-enter the command you used to start it.

Resources