Issues with https and Service Fabric - https

While trying to implement https on our ServiceFabric backend, following this guide, I found my local cluster throwing following error:
There was an error during CodePackage activation.The service host
terminated with exit code:1
and sometimes the following would pop up:
fabric:/Dev.Project/Api is not ready, 1
partitions remaining. => Something is taking too long, the application
is still not ready.
In the Diagnostic Events I find this
{
"Timestamp": "2018-08-20T12:01:21.6423999+02:00",
"ProviderName": "Microsoft-ServiceFabric",
"Id": 23083,
"Message": "ApplicationHostTerminated: ApplicationId=fabric:/Dev.Project, ServiceName=fabric:/Dev.Project/Api, ServicePackageName=ApiPkg, ServicePackageActivationId=1d4426dc-3d5e-41ea-aa44-6e9794ff7c69, IsExclusive=True, CodePackageName=Code, EntryPointType=Exe, ExeName=Setup.bat, ProcessId=29024, HostId=77c22be7-b993-46c6-92dd-7c7ed0c8af1c, ExitCode=1, UnexpectedTermination=True, StartTime=12:01:21.568939 (151,099.982 MSec). ",
"ProcessId": 25768,
"Level": "Informational",
"Keywords": "0x4000000000000001",
"EventName": "Hosting",
"ActivityID": null,
"RelatedActivityID": null,
"Payload": {
"eventInstanceId": "6dbdc967-85ed-429a-ae6a-939aeeea1e3f",
"applicationName": "fabric:/Dev.Project",
"ServiceName": "fabric:/Dev.Project/Api",
"ServicePackageName": "ApiPkg",
"ServicePackageActivationId": "1d4426dc-3d5e-41ea-aa44-6e9794ff7c69",
"IsExclusive": true,
"CodePackageName": "Code",
"EntryPointType": 1,
"ExeName": "Setup.bat",
"ProcessId": 29024,
"HostId": "77c22be7-b993-46c6-92dd-7c7ed0c8af1c",
"ExitCode": 1,
"UnexpectedTermination": true,
"StartTime": "2018-08-20T12:01:21.5689395+02:00"
}
}
The Id being the Id of my Api-service. It probably has something to do with the Setup.bat that's not being executed correctly, or errors are thrown while running it, but I can't figure out what to do about it. As stated in the guide, I added the
<Principals>
<Users>
<User Name="SetupAdminUser">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
</Principals>
part, and added the RunAsPolicy to the service as well
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ApiPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides>
<ConfigOverride Name="Config">
...
</ConfigOverride>
</ConfigOverrides>
<EnvironmentOverrides CodePackageRef="Code">
...
</EnvironmentOverrides>
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="SetupAdminUser" EntryPointType="Setup" />
</Policies>
</ServiceManifestImport>
I searched all over, but I can't find what the problem is. Any input is welcome!
Thanks in advance!

This works for me.
I have added LocalSystem instead of Admin user.
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="SetupLocalSystem" EntryPointType="Setup" />
</Policies>
<Principals>
<Users>
<User Name="SetupLocalSystem" AccountType="LocalSystem" />
</Users>
Also take care of DNS name in SetCertAccess.ps1 file, it should be same as cluster name.
$subject="your cluster DNS name"

Related

Problem when trying to deploy Community Page on salesforce

I'm getting this error when I'm trying to deploy a community page to one sandbox. I pull the same thing from another sandbox.
These are my errors:
Here is my package.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CommunityTemplateDefinition</name>
</types>
<types>
<members>Dealer_Community</members>
<name>CustomSite</name>
</types>
<types>
<members>Dealer Community</members>
<name>Network</name>
</types>
<types>
<members>Dealer_Community1</members>
<name>ExperienceBundle</name>
</types>
<version>55.0</version>
</Package>
And this is the folder that generates error with loginAppPageId:
{
"forgotPasswordRouteId" : null,
"isAvailableToGuests" : false,
"isFilteredComponentsView" : false,
"isProgressiveRenderingEnabled" : true,
"loginAppPageId" : null,
"mainAppPageId" : "2fe3359b-d766-429e-9d67-ec8afe81cc47",
"preferredDomain" : "none",
"selfRegistrationRouteId" : null,
"type" : "site"
}
Any ideea on this? Thanks!

WSO2 Payload Factory not working as expected

I am having troubles configuring the Payload Factory to make it work as expected.
I am trying to process the response of a backend service, which is:
<Documents xmlns="http://ws.wso2.org/dataservice">
<Document>
<Data>
{ "_id" : { "$oid" : "5bbce6ec9e0aae7e5c3a150a"} , "Plan" : "XXXX"}
</Data>
</Document>
<Document>
<Data>
{ "_id" : { "$oid" : "5bbce7279e0aae7e5c3a150b"} , "Plan" : "YYYY"}
</Data>
</Document>
</Documents>
I need to extract the json in each Data tag and construct a JSON that looks something like:
{
Data:
{
_id: {...},
Plan: ...
}
}
Just for testing purposes, I was trying to use the Payload Factory Mediator to get all Data tags using XPath. This is the outSequence of my API (again, the response that comes from the backend is just like the one above):
<outSequence>
<payloadFactory media-type="xml">
<format>
<newTestData>$1</newTestData>
</format>
<args>
<arg evaluator="xml" expression="//Data" />
</args>
</payloadFactory>
<log level="full" />
</outSequence>
The problem is that the log shows that the newTestData tag is empty after the Payload Factory process the response message.
The XPath was tested in an XPath Online Tester and it is correct so: what am I doing wrong?

FetchXML Localization

I have a FetchXML Query that returns the correct entities for my portal.
How do I get the translated values stored in my CRM
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="testentity">
<attribute name="xyz_testclassification" />
<attribute name="xyz_schemaname" />
</entity>
</fetch>
Working with XML and assuming attribute "xyz_testclassification" is an option set type your FetchXML query could return a resultset like this:
<resultset morerecords="0">
<result>
<xyz_testclassification name="Option One" formattedvalue="10003">10003</xyz_testclassification><xyz_schemaname>One</xyz_schemaname>
</result>
<result />
<result>
<xyz_testclassification name="Option Two" formattedvalue="10004">10004</xyz_testclassification><xyz_schemaname>Two</xyz_schemaname>
</result>
<result>
<xyz_testclassification name="Option Three" formattedvalue="10001">10001</xyz_testclassification><xyz_schemaname>Three</xyz_schemaname>
</result>
</resultset>
Here XML attribute "name" contains the display name of the option value. Attribute "formattedvalue" is only useful for numeric attributes (int, decimal, double, money).
When you are using FetchXML in C#, method IOrganizationService.RetrieveMultiple will return Entity objects. The Entity class has a FormattedValues collection containing the display values.
All values are returned according to the language and formatting settings of the user on behalf of whom the system is queried.
I agree with Henk van Boeijen. I'd like to add that if you using the Web Api endpoint it is also possible by adding "Prefer: odata.include-annotations="OData.Community.Display.V1.FormattedValue" in the header of the request.
HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal
OData-Version: 4.0
Preference-Applied: odata.include-annotations="OData.Community.Display.V1.FormattedValue"
{
"#odata.context": "[Organization URI]/api/data/v8.2/$metadata#accounts(name,donotpostalmail,accountratingcode,numberofemployees,revenue)",
"value": [
{
"#odata.etag": "W/"502170"",
"name": "Fourth Coffee (sample)",
"donotpostalmail#OData.Community.Display.V1.FormattedValue": "Allow",
"donotpostalmail": false,
"accountratingcode#OData.Community.Display.V1.FormattedValue": "Default Value",
"accountratingcode": 1,
"numberofemployees#OData.Community.Display.V1.FormattedValue": "9,500",
"numberofemployees": 9500,
"revenue#OData.Community.Display.V1.FormattedValue": "$100,000.00",
"revenue": 100000,
"accountid": "89390c24-9c72-e511-80d4-00155d2a68d1",
"transactioncurrencyid_value": "50b6dd7b-f16d-e511-80d0-00155db07cb1" } ]
}
For more details: https://msdn.microsoft.com/en-us/library/gg334767.aspx

Cordova $.ajax request wont work

I am having issue with cordova ajax reuest.
$.ajax({
url: syncURL,
data: (changed ? {start: changed + 1} : ''),
dataType: "json",
success: function (data) {
console.log('Ajax success');
callback(data);
},
error: function(model, response) {
console.log('Ajax error');
//app.notify(response.responseText, 'error');
callback(null);
}
});
The program shows Ajax success in console log. I can see the content inside app while watching it on the browser with:
cordova serve
Unfortunately if i want to deploy to ios simulator or on android device, the app wont load the content and get an empty json with no data.
What i am doing wrong. The simulator or android device got network connection.
I dont see nothing in log too.
Also added
cordova plugins add cordova-plugin-whitelist
cordova version is 7.1.0
I bumped into same error starting with phonegap-vue-f7 template and using axios as Ajax library.
For same request to http://my.domain.com/api/request :
returns code 200 with local cordova serve (npm start with phonegap-vue-f7 template)
returns code 404 when I deployed to real device
The phonegap-vue-f7 template furnish a pre-filled config.xml with this:
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
at this point I had to install cordova-plugin-whitelist to make it work.
So the cordova-plugin-whitelist plugin correctly configured seem to be the answer.
not sure, but may be the data: value is not correct
data: (changed ? {start: changed + 1} : '')
What if you change to:
data: (changed ? '{start: changed + 1}' : '')

How could I properly configure Solr to index my Oracle database?

I've been trying to configure Solr to work with my Oracle 11.2 database as a datasource but nothing works. I have thoroughly explored the documentations and it seems to lack a good and working guide.
For a simple scenario, I want to index my single table [topic]
The structure of my table topic is shown below:
ID (autonumber)
Topic (varchar 50) I want to index this
Info (varchar 255) I want to index this
My solr configurations (so far)
I have added a new collection for this Oracle, name it "oracle_test". So I configure the folder structure as guided by the official documentation for this collection as follows:
~/solr/server/solr/
oracle_test
conf
data-config.xml
elevate.xml
schema.xml
solrconfig.xml
data-config.xml
I have configured a working datasource connection string to my Oracle, specified the query to my topic table, also the fields I want Solr to look up.
<dataConfig>
<dataSource name="jdbc" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:system#//127.0.0.1:1521/orcl/" user="system" password="*****"/>
<document>
<entity name="help" query="select \"topic\",\"info\" from \"topic\"" dataSource="jdbc">
<field column="topic" name="topic"/>
<field column="info" name="info"/>
</entity>
</document>
</dataConfig>
schema.xml
I put the definitions of fields here.
<schema name="oracle_help" version="1.1">
<fieldType name="string" class="solr.StrField"/>
<field name="topic" type="string" indexed="true" stored="true" multiValued="false"/>
<defaultSearchField>info</defaultSearchField>
<field name="topic" type="string" indexed="true" stored="true"/>
<field name="info" type="string" indexed="true" stored="true"/>
</schema>
solrconfig.xml
Since the configuration file is big and it includes everything. I will take only some excerpts from this configuration file which is related to the Oracle configuration as follows:
I specify which field (topic) I want it to index:
<initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
<lst name="defaults">
<str name="df">topic</str>
</lst>
</initParams>
Under processor section, I have only one default field type defined as string:
<processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
<str name="defaultFieldType">strings</str>
...
</processor>
Then I tried importing the datasource via Solr Admin
Using "DataImport" on Solr Admin dashboard, once execute the command, I got this response back which I'm not sure whether it correctly indexed my Oracle table:
{
"responseHeader": {
"status": 0,
"QTime": 1
},
"initArgs": [
"defaults",
[
"config",
"data-config.xml"
]
],
"command": "status",
"status": "idle",
"importResponse": "",
"statusMessages": {}
}
Weird thing is, the status is indicated as "idle".
I tried to execute search query, but it returns error
Use the search query "test" as follows:
$> curl http://localhost:8983/solr/oracle_test/select?q=test&wt=json&indent=true
Solr returns me "undefined field topic".
{
"responseHeader": {
"status": 400,
"QTime": 1,
"params": {
"q": "called",
"indent": "true",
"wt": "json",
"_": "1434341618019"
}
},
"error": {
"msg": "undefined field topic",
"code": 400
}
}
But, as shown at the earlier part, obviously I have already defined the field "topic" in my schema.xml. It seems lack of documentation or guide on Solr official sites and I tried doing some research on Internet, but I've got nothing at all.
Can anybody who might be familiar with Solr - Oracle integration please help me figure this out? Any suggestion?
I think your Solr server should generate an error upon start-up or when you are trying to access the index that uses the schema.xml you have defined. Please have a look into the logs of your solr server.
It has formal errors, these prevent the index from starting and in turn the DIH you have defined from running
<types /> is missing around your field types
<fields /> is missing around your fields
<defaultSearchField /> is missplaced inside your fields
you have defined the field named topic twice
The structure of a schema.xml is documented in Solr's Wiki. A valid version of your schema.xml would look like the sample below.
<schema name="oracle_help" version="1.1">
<types>
<fieldType name="string" class="solr.StrField"/>
</types>
<defaultSearchField>info</defaultSearchField>
<fields>
<field name="topic" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="info" type="string" indexed="true" stored="true"/>
</fields>
</schema>
The approach which you are using seems to be fine. In solrConfig.xml try using below line
<str name="config">/path/to/my/DIHconfigfile.xml</str>
instead of <str name="df">topic</str>

Resources