I am able to create an access review using this JSON:
{
"displayName": "Test-review-2 Group Membership Review",
"startDateTime":"2020-01-15T00:00:11.111Z",
"endDateTime":"2020-04-04T00:00:11.111Z",
"reviewedEntity":
{
"id": "f4b4b660-a6c2-4b1f-bb16-75f81432a63e"
},
"reviewerType" : "entityOwners",
"businessFlowTemplateId": "6e4f3d20-c5c3-407f-9695-8460952bcc68",
"description":"Access Review for the AAD group:Test-review-2(f4b4b660-a6c2-4b1f-bb16-75f81432a63e)",
"settings":
{
"mailNotificationsEnabled":true,
"remindersEnabled": true,
"justificationRequiredOnApproval":true,
"autoReviewEnabled":false,
"activityDurationInDays":365,
"autoApplyReviewResultsEnabled":true,
"accessRecommendationsEnabled":false,
"recurrenceSettings":
{
"recurrenceType":"onetime",
"recurrenceEndType":"occurrences",
"durationInDays":7,
"recurrenceCount":3
},
"autoReviewSettings":{
"notReviewedResult":"Approve"
}
}
}
If I change the recurrenceType to "weekly", I suddenly get an error:
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.AggregateException: One or more errors occurred. (Message: An error has occurred.
Inner error:
AdditionalData:
request-id: c1ba20d2-4fbb-45e4-ac89-a7f0ebb650ba
date: 2020-01-14T19:54:42
ClientRequestId: c1ba20d2-4fbb-45e4-ac89-a7f0ebb650ba
)
---> Status Code: InternalServerError
Microsoft.Graph.ServiceException: Message: An error has occurred.
Inner error:
AdditionalData:
request-id: c1ba20d2-4fbb-45e4-ac89-a7f0ebb650ba
date: 2020-01-14T19:54:42
ClientRequestId: c1ba20d2-4fbb-45e4-ac89-a7f0ebb650ba
I have looked through the documentation, and can't understand why.. Is there a dependent property I'm missing?
It looks like, in your example, recurrenceSettings is being passed in with the following values:
"recurrenceSettings":
{
"recurrenceType":"weekly",
"recurrenceEndType":"occurrences",
"durationInDays":7,
"recurrenceCount":3
},
"autoReviewSettings":{
"notReviewedResult":"Approve"
}
There are limits to the duration in days that one can specify for recurring reviews:
weekly -> 6
monthly -> 27
quarterly -> 80
annual -> 360
The durationInDays value that you’re passing for recurrenceType weekly is greater than the allowed maximum(6). Please try setting a value less than 7.
Related
I have this GraphQL query:
query QuoteRequests($page: Int!) {
getQuoteRequestsList(page: $page) {
vehicle
body
licensePlate
vin
quality
currency
items
}
}
It generates this sample result:
{
"data": {
"getQuoteRequestsList": [
{
"vehicle": "1997 TOYOTA AVALON 4 DR ",
"body": "Sedan",
"licensePlate": "RHJ456",
"vin": "XBGGDFYYREAXVJJJD",
"quality": [
"GENUINO"
],
"currency": "USD",
"items": [
{
"uid": "74355f85-5312-9999-8acd-709ceccda00a",
"name": "Doble cero que es",
"description": "no me interesa",
"quantity": 11
},
{
"uid": "66db6fe0-1044-4d58-8454-5e51ab7a313f",
"name": "El arenero",
"description": "el duende verde",
"quantity": 2
}
]
},
]
}
}
The items data is a JSON type, and when trying to fetch that data by using Ferry package with
client.request(GQuoteRequestsReq((b) => b..vars.page = 0)).listen((response) => print(response.data.toString()));
I get a Null result, but if I leave items out of the query, I get a no-null result. I have no problem if I run that query using the HTTP package.
Is this is an error from Package? or do I need to configure something?
Thanks.
UPDATE 1
This is definitely an error because if I try to make a hot-reload in Flutter I get this error in debug console:
Reloaded 1 of 1700 libraries in 860ms.
E/flutter ( 2286): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Deserializing '[__typename, Query, getQuoteRequestsList, [{__typename: GetQuoteRequestsRecor...' to 'GQuoteRequestsData' failed due to: Deserializing '[{__typename: GetQuoteRequestsRecord, uid: 0bf6709f-7ab7-464e-8ee3-6a94e46f05...' to 'BuiltList<GQuoteRequestsData_getQuoteRequestsList>' failed due to: Deserializing '[__typename, GetQuoteRequestsRecord, uid, 0bf6709f-7ab7-464e-8ee3-6a94e46f057...' to 'GQuoteRequestsData_getQuoteRequestsList' failed due to: Deserializing '[{uid: 16870250-5acb-4c23-a7e4-f4e23bbd23ad, name: Doble cero que es, descrip...' to 'GJSON' failed due to: type 'List<dynamic>' is not a subtype of type 'String?' in type cast
E/flutter ( 2286): #0 BuiltJsonSerializers._deserialize
package:built_value/src/built_json_serializers.dart:178
E/flutter ( 2286): #1 BuiltJsonSerializers.deserialize
package:built_value/src/built_json_serializers.dart:124
It's clear it is fetching the expected result but it cannot deserialize properly, then it returns a null result.
Is there any workaround?
UPDATE 2
I've tried this solution but I'm getting same error.
In my case, I've followed these steps, I've
installed built_value package,
edited build.yaml file,
run the command flutter packages pub run build_runner build
The answer can be found in this issue.
I upgraded my grails version from 3.8 to 4. In this step I upgraded the liquibase to 3.10.1.
Now my application won't startup any more. I get an error on this changeset:
changeSet(author: "prog1", id: "httpconnector-add-ignoreSSLVerification") {
addColumn(tableName: "inbound_connector") {
column(name: "ignoresslverification ", type: "boolean")
}
addColumn(tableName: "outbound_connector") {
column(name: "ignoresslverification ", type: "boolean")
}
sql("UPDATE outbound_connector set ignoresslverification = true")
sql("UPDATE inbound_connector set ignoresslverification = true")
}
I get this error:
liquibase.exception.MigrationFailedException: Migration failed for change set migrations/changelog.groovy::httpconnector-add-ignoreSSLVerification::ff:
Reason: liquibase.exception.DatabaseException: ERROR: column "ignoresslverification" of relation "outbound_connector" does not exist
Position: 31 [Failed SQL: (0) UPDATE outbound_connector set ignoresslverification = true]
What is the problem here?
I found the error: There is a blank at at column name. The old version ignored this, but the new version not.
After sending the following post request to Microsoft Germany endpoint (https://graph.microsoft.de/v1.0), I got 400 UnableToDeserializePostBody, but I received 201 after I sent the same request to Microsoft Graph endpoint (https://graph.microsoft.com/v1.0).
Is there limitation on Germany endpoint?
Request
POST https://graph.microsoft.de/v1.0/users/xxx/events/
{
"attendees":[],
"body":{
"content":"<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=iso-2022-jp\">\r\n<style type=\"text/css\" style=\"display:none\">\r\n<!--\r\np\r\n\t{margin-top:0;\r\n\tmargin-bottom:0}\r\n-->\r\n</style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<div id=\"divtagdefaultwrapper\" dir=\"ltr\" style=\"font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif\">\r\n<p style=\"margin-top:0; margin-bottom:0\"><br>\r\n</p>\r\n</div>\r\n</body>\r\n</html>\r\n",
"contentType":"html"
},
"bodyPreview":"",
"categories":[],
"changeKey":"V3BbxVnFKUiKHwfECS7njQABscz/wA==",
"createdDateTime":"2020-06-22T08:04:02.7260413Z",
"end": {
"dateTime":"2020-06-23T00:30:00.0000000",
"timeZone":"UTC"
},
"hasAttachments":false,
"iCalUId":"",
"id":"AAMkADY5ODA5YjI4LTZlMmEtNDk5My1hNTcxLTFmMDJlMTFlM2ZmYQBGAAAAAADXELVefACVTqbk5n3dmlnfBwBXcFvFWcUpSIofB8QJLueNAAGx1uUKAABXcFvFWcUpSIofB8QJLueNAAGx1vTOAAA=",
"importance":"normal",
"isAllDay":false,
"isCancelled":false,
"isOrganizer":true,
"isReminderOn":true,
"lastModifiedDateTime":"2020-06-22T08:04:03.3837944Z",
"location":{
"address":{
"city":"",
"countryOrRegion":"",
"postalCode":"",
"state":"",
"street":""
},
"coordinates":{},
"locationType":"default",
"uniqueIdType":"unknown"
},
"onlineMeetingUrl":"",
"organizer":{
"emailAddress":{
"address":"a#b",
"name":"test"
}
},
"originalEndTimeZone":"Taipei Standard Time",
"originalStart":null,
"originalStartTimeZone":"Taipei Standard Time",
"recurrence":null,
"reminderMinutesBeforeStart":15,
"responseRequested":true,
"responseStatus":{
"response":"organizer",
"time":"0001-01-01T00:00:00Z"
},
"sensitivity":"normal",
"seriesMasterId":"",
"showAs":"busy",
"start":{
"dateTime":"2020-06-23T00:00:00.0000000",
"timeZone":"UTC"
},
"subject":"1",
"type":"singleInstance",
"webLink":"https://outlook.office.de/owa/?itemid=AAMkADY5ODA5YjI4LTZlMmEtNDk5My1hNTcxLTFmMDJlMTFlM2ZmYQBGAAAAAADXELVefACVTqbk5n3dmlnfBwBXcFvFWcUpSIofB8QJLueNAAGx1uUKAABXcFvFWcUpSIofB8QJLueNAAGx1vTOAAA%3D&exvsurl=1&path=/calendar/item"
}
Response from Germany endpoint
400 Bad Request
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize ",
"innerError": {
"date": "2020-08-07T08:44:52",
"request-id": "ce4c6d23-9163-42a1-9839-787596f7533b"
}
}
}
You've probably given up or fixed it by now but I just had this error when setting color. I used an integer but when I changed to string it was ok.
I notice you have "reminderMinutesBeforeStart":15 try it as "reminderMinutesBeforeStart":"15".
I ran into the same issue, and as louisl mentioned it was a problem with using the wrong primitive types in the request object.
I found this library of Typescript Types for the Microsoft Graph Client: https://github.com/microsoftgraph/msgraph-typescript-typings. This library provided the "Event" type, which is what I believe you're using.
Below is a snippet of Typescript that helped me ensure my request object was correct. Notice the Event import and the explicit typing of the eventRequest constant.
import { Event, Attendee } from '#microsoft/microsoft-graph-types'
const eventRequest: Event = {
subject: name,
body: {
contentType: 'html',
content: ...
},
...
}
If you're using VSCode and a Mac you can command + click on the type to look at the definition directly, so you can see what properties are optional, and what types they require. I found Microsoft's type library and in-line comments to be more up-to-date than the official documentation.
It's really useful to explore the type file to get a better idea of how the Microsoft Client works. This principle has been helpful with other libraries as well.
I got the demo example from grand-stack and was able to start up graphql, start up the Neo4J sandbox and populate the test database using
npm run seedDb
However, when I try to write my own data entries to populate into a neo4j database, I cannot get the relation between nodes to work at all. The error message is the most non-useful message (and I believe it is from the apollo client, and is a status code 400 error). I simplified the code to the most simplest case to make it work, and it still does not. Here is the schema.graphql file:
type Patient {
id: ID!
name: String
reviews: [Review] #relation(name:"WROTE", direction:"OUT")
}
type Review {
id: ID!
stars: Int
text: String
date: Date
user: Patient #relation(name: "WROTE", direction: "IN")
}
and here is the seed-mutation.js file:
export default /* GraphQL */ `
mutation {
p1: CreatePatient(
id: "p1",
name: "John Doe 1"
) {
id
name
}
r1: CreateReview(id: "r1", stars: 4, text: "Great IPA selection!", date: { formatted: "2016-01-03"}) {
id
}
ar1: AddUserReviews(from: { id: "p1"}, to: { id: "r1" }) { from {id}}
}
`;
When I do "npm run seedDb", this yields the error message:
{ Error: Network error: Response not successful: Received status code 400
at new ApolloError (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/apollo-client/bundle.esm.js:60:28)
at Object.error (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/apollo-client/bundle.esm.js:1032:48)
at notifySubscription (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:134:18)
at onNotify (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:165:3)
at SubscriptionObserver.error (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:224:7)
at /Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/apollo-link-http/src/httpLink.ts:184:20
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
graphQLErrors: [],
networkError:
{ ServerError: Response not successful: Received status code 400
at Object.exports.throwServerError (/Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/apollo-link-http-common/src/index.ts:114:17)
at /Users/xxxx/Downloads/grand-stack-starter-master/api/node_modules/apollo-link-http-common/src/index.ts:145:11
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
name: 'ServerError',
response:
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: [Object],
[Symbol(Response internals)]: [Object] },
statusCode: 400,
result: { errors: [Array] } },
message: 'Network error: Response not successful: Received status code 400',
extraInfo: undefined }
I started with multiple complex codes and this is pretty much the most stripped down version. When I run the seedDB command after the seed-mutation.js file was modified to:
export default /* GraphQL */ `
mutation {
p1: CreatePatient(
id: "p1",
name: "John Doe 1"
) {
id
name
}
r1: CreateReview(id: "r1", stars: 4, text: "Great IPA selection!", date: { formatted: "2016-01-03"}) {
id
}
}
`;
the database gets populated, however the two nodes are not connected to each other, as expected (basically, this is the code with the AddUserReviews removed). How do I build the relation between the nodes through using graphql and seedDb? What am I missing?
You can use GraphQL Playground to inspect the GraphQL API (in the "Docs" tab):
to ensure the mutations you are calling have the correct name and arguments. From inspecting the schema, it looks like instead of AddUserReviews, you want AddPatientReviews?
Problem:
I am unable to POST a transaction via the RESTful API generated by the composer-rest-server. I am receiving statusCode 422; the transaction instance is not valid. However, the same example works in the Playground.
Scenario:
I've set up a transaction called Offer in my .cto file which posts an offer to buy a house:
// Offer - Specifies an offer that a bidder places on a house listing with an associated price
transaction Offer {
o Double bidPrice
--> HouseListing listing
--> Person bidder
}
The composer-rest-server has generated an API with the following JSON string to post a transaction of type Offer:
{
"$class": "org.acme.purchasing.Offer",
"bidPrice": 0,
"listing": "string",
"bidder": "string",
"transactionId": "string",
"timestamp": "2017-07-21T13:37:09.460Z"
}
I've since replaced this with a sample transaction using the following JSON code derived from the above example:
{
"$class": "org.acme.purchasing.Offer",
"bidPrice": 1000,
"listing": "001",
"bidder": "RJOHNSON",
"transactionId": "1b9aa63c-dfad-4aad-a610-dfc80f2796b2",
"timestamp": "2017-07-21T13:37:09.460Z"
}
The response returned is error code 422:
{
"error": {
"statusCode": 422,
"name": "ValidationError",
"message": "The `Offer` instance is not valid. Details: `transactionId` can't be set (value: \"1b9aa63c-dfad-4aad-a610-d...6b2\").",
"details": {
"context": "Offer",
"codes": {
"transactionId": [
"absence"
]
},
"messages": {
"transactionId": [
"can't be set"
]
}
},
"stack": "ValidationError: The `Offer` instance is not valid. Details: `transactionId` can't be set (value: \"1b9aa63c-dfad-4aad-a610-d...6b2\").\n at /usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/dao.js:355:12\n at ModelConstructor.<anonymous> (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:566:11)\n at ModelConstructor.next (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/hooks.js:93:12)\n at ModelConstructor.<anonymous> (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:563:23)\n at ModelConstructor.trigger (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/hooks.js:83:12)\n at ModelConstructor.Validatable.isValid (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:529:8)\n at /usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/dao.js:351:9\n at doNotify (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at Function.ObserverMixin._notifyBaseObservers (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:178:5)\n at Function.ObserverMixin.notifyObserversOf (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:153:8)\n at Function.ObserverMixin._notifyBaseObservers (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:176:15)\n at Function.ObserverMixin.notifyObserversOf (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:153:8)\n at Function.ObserverMixin._notifyBaseObservers (/usr/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:176:15)"
}
}
Now the strange thing is that I've deployed the same BNA onto the Hyperledger Composer Playground and am able to execute transactions of type Offer successfully.
Note that in the Playground, "transactionId" and "timestamp" are not specified as the Playground appears to take care of these values. For example, this is what Playground proposes to me initially:
{
"$class": "org.acme.purchasing.Offer",
"bidPrice": 0,
"listing": "resource:org.acme.purchasing.HouseListing#id:7965",
"bidder": "resource:org.acme.purchasing.Person#id:4441"
}
Can anyone advise why it's saying the Offer instance is not valid? My first thought was that it's not liking the string I'm placing in "transactionId" but another Stack Overflow post points out that the transactionId is just an arbitrary UUIDv4 string which I've generated already.
Update #1: Failing even with default demo
In order to ensure by BNA is error-free, I've deployed the default carauction-demo (resembles my example closely) onto my local Hyperledger Fabric instance and deployed the composer-rest-server. I've also deployed the same BNA into the Playground. All assets and participants were created identical in both from the Explorer (local instance) and Playground. When it comes time to submit an Offer transaction:
{
"$class": "org.acme.vehicle.auction.Offer",
"bidPrice": 800,
"listing": "resource:org.acme.vehicle.auction.VehicleListing#L001",
"member": "resource:org.acme.vehicle.auction.Member#member3#acme.org"
}
This JSON was generated by the Playground and succeeds there. Copy/paste/executing into the Explorer yields a status 500 error.
{
"error": {
"statusCode": 500,
"name": "Error",
"message": "error trying invoke chaincode. Error: chaincode error (status: 500, message: Error: Object with ID 'string' in collection with ID 'Asset:org.acme.vehicle.auction.VehicleListing' does not exist)",
"stack": "Error: error trying invoke chaincode. Error: chaincode error (status: 500, message: Error: Object with ID 'string' in collection with ID 'Asset:org.acme.vehicle.auction.VehicleListing' does not exist)\n at _initializeChannel.then.then.then.then.catch (/usr/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:806:34)"
}
}
I'm still at a lost as to what is wrong here.
After much experimentation and some searching, I've concluded that the problem was that NPM was installed using sudo (as root). I redid the installation as non-root and the problem has now been solved. Everything is working as expected.
Composer updates the transactionId itself as its generated, you cannot do this in your JSON and hence why you get the error. This is a Loopback -> Swagger conversion issue as it should not appear in a /POST REST operation - captured here https://github.com/hyperledger/composer/issues/663
So I have successfully executed Offer transactions (/POST). I think the '500' error is because there is a missing field ('string' type), or relationship in your Offer transaction via REST.
Using the example of the Car Auction network https://github.com/hyperledger/composer-sample-networks/blob/master/packages/carauction-network/models/auction.cto
Either of these Offer transactions using /POST were successful in Explorer:
{
"$class": "org.acme.vehicle.auction.Offer",
"bidPrice": 20,
"listing": "org.acme.vehicle.auction.VehicleListing#100",
"member": "org.acme.vehicle.auction.Member#a#b.com"
}
OR
{
"$class": "org.acme.vehicle.auction.Offer",
"bidPrice": 20,
"listing": "org.acme.vehicle.auction.VehicleListing#100",
"member": "org.acme.vehicle.auction.Member#a#b.com",
"timestamp": "2017-07-28T14:07:02.558Z"
}
responded with a 200 (SUCCESS) and a transactionId in Explorer:
{
"$class": "org.acme.vehicle.auction.Offer",
"bidPrice": 20,
"listing": "org.acme.vehicle.auction.VehicleListing#100",
"member": "org.acme.vehicle.auction.Member#a#b.com",
"transactionId": "e75b9934-1f08-4daf-90db-702bbe4b8fa1"
}
This is my VehicleListing asset JSON for #100 above
{
"$class": "org.acme.vehicle.auction.VehicleListing",
"listingId": "100",
"reservePrice": 50,
"description": "string",
"state": "FOR_SALE",
"offers": [
{
"$class": "org.acme.vehicle.auction.Offer",
"bidPrice": 50,
"listing": "100",
"member": "resource:org.acme.vehicle.auction.Member#a#b.com",
"transactionId": "string123",
"timestamp": "2017-07-28T14:07:02.825Z"
}
],
"vehicle": "resource:org.acme.vehicle.auction.Vehicle#123"
}
And I created asset for Vehicle 123 as well as Member a#b.com