Quantcast
Viewing all 1524 articles
Browse latest View live

Node platform api crud example not working

@Dennie wrote:

Can someone explain to me if I'm doing something wrong or if the NodeJS CRUD example (http://wiki.dreamfactory.com/DreamFactory/Tutorials/Node_platform_api_crud) is broke.

Created a service and copied the example code. The only thing changed is the database which I changed to mongodb and created the "todo" scheme. Beside this I only call the function createInternal(...) which should add a record to the todo schema.
When I call the service from the API Docs I get the following response:

{
"error": {
"message": "No record(s) detected in request.",
"code": 500
}
}

Can someone explain how to do it the right way?

I'm running a Bitnami VM with DF v2.4.2 on google cloud with the async package installed

Regards,
Dennie

Posts: 1

Participants: 1

Read full topic


Queued NodeJS Server-Side Script and exception throwing

@tizzyapunkt wrote:

NodeJS Queued Server-Side Script succeeds even on throwing an exception.

To check if I missed something I simply created a NodeJS Server-Side Script with the following code:

throw new Error('Something went wrong');

If I call the Endpoint with any method but without queueing the script, the server responds with error 500 and the script execution stops immediately.

If I call the Endpoint with any method but with queueing the script and then let the worker execute it from the queue, no exception get's thrown, the job succeeds and it disappears from the queue. This is bad because I need to take care of failed jobs (retrying later, check whats wrong etc.)

I tested this with V8js as script type and this works as expected (stops execution of the script, don't deletes it from the queue, increasing attempts by 1 etc.) with and without queuing.

Because of a lot of async stuff, I cannot user V8js here and I am in need of NodeJS.

Any suggestions on that?

Posts: 1

Participants: 1

Read full topic

DB: Table-Valued Function Support

@deanstalker wrote:

I would love know how progress is going on further extended table-valued function support. ie.
SELECT * FROM tableFunction(param1) WHERE param2 = 'etc'

I did notice this commit which implements basic handling to the SQLSRV module, however it isn't filterable which is a big gap in functionality.

Cheers,

Dean

Posts: 1

Participants: 1

Read full topic

How upload a file at file storage with the .net-sdk

Upload file to file storage

How to create a php service

@kalmenchia wrote:

Hi , i have tried to create a php service with the following ....

<?php
class myClass 
{
    function myClass(p1,p2){
         return p1;
    }

  private function getObjArr($object){
      return (array)$object;
   }

}

   //----- main 
  $verb = $event['request']['method'];

  if($verb !== 'GET'){
throw new \DreamFactory\Core\Exceptions\BadRequestException('Only HTTP GET is allowed on this endpoint.');
   }

  // -----> the rest of the call 
  $mc = new myClass( 1 , 2 ) ;
  ...
  ?>

my question is that will my php code with the class defined like above work ?
appreciate any advice.

thanks,
kalmen

Posts: 1

Participants: 1

Read full topic

DF call Postgresql function with wrong parameters

@hat04 wrote:

Hello
I use df to call postgresql function.
On my server I have 3 function with same name and difference parameters

1 - FUNCTION "public"."getcuscardmark"("pma_kh" varchar) RETURNS "pg_catalog"."numeric"
2 - FUNCTION "public"."getcuscardmark"("pma_kh" varchar, "pngay_ct" date, "ptime0" time) RETURNS "pg_catalog"."numeric"
3 - FUNCTION "public"."getcuscardmark"("pma_kh" varchar, "pstt_rec_dh" varchar) RETURNS "pg_catalog"."numeric"

Last week, when I run df with

POST http://api...../api/v2/myerp/_func/getcuscardmark
with BODY
{
"params":[
{
"name":"pma_kh",
"value":"KLE"
}
]
}

I have error function getcuscardmark(unknown, unknown, unknown, unknown) does not exist, I don't know why df call this function, but I create new function

FUNCTION "public"."getcuscardmark"("pma_kh" varchar, "para2" varchar, "para3" varchar, "para4" varchar) RETURNS "pg_catalog"."numeric"
to let my app run.

Today, when I call function POST http://api...../api/v2/myerp/_func/getcuscardmark with same body I have same error too but has difference parameters

{"error":{"context":null,"message":"Failed to call database stored function.
SQLSTATE[42883]: Undefined function: 7 ERROR: function getcuscardmark(unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist
LINE 1: SELECT * FROM "getcuscardmark"($1, $2, $3, $4, $5, $6, $7) ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.","code":500}}

Why DF call PostgreSQL with strange parameters?

Please help me.
Thank in advance

Posts: 1

Participants: 1

Read full topic

Importing virtual relationships while using SQLite or MySql

@Tyler_Cox wrote:

I am using an SQLite database, mostly because that is what the project started with, however I am willing to move it over to a MySQL database, which I probably will in the future for the better features.

I am trying to transfer virtual relationships using the json schema upload/modify tools.

When I create a new table with the upload, and I pass in a table schema with the relationship description afterwards, the table is created but the relationships are not brought in. If I then try to modify the json schema in the dreamfactory tools, and the press save, it says I can't alter in sqlite, but if I do it using MYSQL it says:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (bitnami_dreamfactory.db_virtual_relationship, CONSTRAINTdb_virtual_relationship_ref_service_id_foreignFOREIGN KEY (ref_service_id) REFERENCESservice(id) ON DELETE CASCADE) (SQL: insert intodb_virtual_relationship(type,service_id,table,field,ref_service_id,ref_table,ref_field,junction_service_id,junction_table,junction_field,junction_ref_field,ref_on_update,ref_on_delete,last_modified_date,created_date) values (has_many, 8, loans, loan_id, 10, Collateral, loan_id, , , , , , , 2017-03-02 17:19:42, 2017-03-02 17:19:42))

It looks like it is trying to (in both sqlite and mysql) insert the relationships, but all I want it to do is have dreamfactory remember the virtual relationships, just like it does when i successfully create them manually. What am I supposed to do so I don't have to go through an entire list of relationships and re-create them every time I want to move to a different location for local testing?

Here is an example json schema:

{
  "alias": null,
  "name": "loans",
  "label": "Loans",
  "description": null,
  "native": [],
  "plural": "Loans",
  "is_view": false,
  "primary_key": "loan_id",
  "name_field": null,
  "field": [
{
  "alias": null,
  "name": "loan_id",
  "label": "Loan Id",
  "description": null,
  "native": [],
  "type": "id",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": true,
  "is_primary_key": true,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "client_id",
  "label": "Client Id",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "loan_start_date",
  "label": "Loan Start Date",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "loan_points",
  "label": "Loan Points",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "loan_amount",
  "label": "Loan Amount",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "loan_contract_id",
  "label": "Loan Contract Id",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "late_payment_fee",
  "label": "Late Payment Fee",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "days_late_before_charged",
  "label": "Days Late Before Charged",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "loan_group",
  "label": "Loan Group",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "package_id",
  "label": "Package Id",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "next_payment_due_timestamp",
  "label": "Next Payment Due Timestamp",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "last_payment_id",
  "label": "Last Payment Id",
  "description": null,
  "native": [],
  "type": "integer",
  "db_type": "int(11)",
  "length": 11,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "origination_fee",
  "label": "Origination Fee",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "late_fee_cache",
  "label": "Late Fee Cache",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "interest_cache",
  "label": "Interest Cache",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": true,
  "allow_null": false,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "payment_cache",
  "label": "Payment Cache",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "principle_cache",
  "label": "Principle Cache",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "balance_cache",
  "label": "Balance Cache",
  "description": null,
  "native": [],
  "type": "float",
  "db_type": "float",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": false,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
},
{
  "alias": null,
  "name": "status_cache",
  "label": "Status Cache",
  "description": null,
  "native": [],
  "type": "text",
  "db_type": "text",
  "length": null,
  "precision": null,
  "scale": null,
  "default": null,
  "required": false,
  "allow_null": true,
  "fixed_length": false,
  "supports_multibyte": true,
  "auto_increment": false,
  "is_primary_key": false,
  "is_unique": false,
  "is_index": false,
  "is_foreign_key": false,
  "ref_table": null,
  "ref_field": null,
  "ref_on_update": null,
  "ref_on_delete": null,
  "picklist": null,
  "validation": null,
  "db_function": null,
  "is_virtual": false,
  "is_aggregate": false
}
  ],
  "related": [
  {
			"alias": null,
			"name": "clients_by_client_id",
			"label": "Clients By Client Id",
			"description": null,
			"native": [],
			"type": "belongs_to",
			"field": "client_id",
			"is_virtual": true,
			"ref_service_id": 10,
			"ref_table": "clients",
			"ref_field": "client_id",
			"ref_on_update": null,
			"ref_on_delete": null,
			"junction_service_id": null,
			"junction_table": null,
			"junction_field": null,
			"junction_ref_field": null,
			"always_fetch": false,
			"flatten": false,
			"flatten_drop_prefix": false
		}
  ],
  "access": 31
}

Edit: Also, I have tried using the normal import and export tools in dreamfactory for the service and database, and it also does not bring through the virtual relationships.

Posts: 1

Participants: 1

Read full topic


Write to MySQL Database After Auccessful OAuth Login

@jcfontecha wrote:

Hello,

The model for the application I am building, binds DreamFactory users to information in a MySQL DB. So far, I've been able to update a MySQL table with the DreamFactory user ID when said new user is created through POST /user/register in a post_process script.

The other mechanism to use this application will be logging in through Facebook. I successfully was able to login users through DreamFactory's OAuth mechanism but I don't know how to update my MySQL DB with the new user that came from OAuth. Can anyone point me in the right direction?

Posts: 1

Participants: 1

Read full topic

Dreamfactroy 2.4.2: Calls to some postgres functions leads to 404 Response

@armin.fraude wrote:

Hi,

my problem is as follows:

No matter how I try to call some of the defined functions in my postgres DB, I always get a 404 Not Found response.
I tested this from my application, Postman developer tool and also in the Dreamfactory Service Plattform.

I checked if I can select those functions for assigning them to a special role (Assign Service Access) and they aren't listed there.
I maked out, that 3 of my defined postgres functions are missing and the remaining 8 are listed (_func/functionname).
(But that was only for verification. I assigned all components of my database to the used role).

So I tried to restart the bitnami services several times, refreshed the Schema in Dreamfactory Service Plattform >> Schema and deleted my functions in the database and created them again.
But all those attempts have been unsuccessful.

Why aren't some functions recognized?
Except those functiones I didn't notice, that any database object isn't listed.

How can I resolve this?

Thank you in advance for any hint
Best Regards

Posts: 1

Participants: 1

Read full topic

2.4.2: Query parameters passed to a V8 script are automatically forwarded to subsequent http-service calls?

@alabala wrote:

Looks like all query parameters passed to a v8 script-service are automatically appended to subsequent platform.api calls, and there is no way to override them within the same script:

curl -X GET "http://localhost:8080/api/v2/v8_service?p=yyyy"

............................................................
//v8_service:
var options = {
parameters: {
p: 'xxxx' //doesn't override event.request.parameters.p
}
};
platform.api.get(http_service, options); //p=yyyy gets passed on to the http_service

....................................................................

This seems to be the case since 2.3.0. Is this a new feature? It breaks our 2.2.1 code.

Posts: 1

Participants: 1

Read full topic

How do I access a JSON in Dreamfactory? [V8JS]

@EM_FLK wrote:

I am calling a JSON from a CRM API and is returned looking like this:


{"response":
{"result":
{"Contacts":
{"row":
{"no":"1",
"FL":
[
{"val":"Name","content":"Billy"},
{"val":"Age","content":"17"},
]
}
}
},
"uri":"/crm/private/json/Contacts/getRecordById"
}
}


However I cannot seem to access it in the manner that I find online and I was wondering if there was a specific method that was used by Dreamfactory.

Posts: 1

Participants: 1

Read full topic

Pre-flight request blocked

@scmathew wrote:

login: function(email, password, callback) {
                alert("In login function");
                $.ajax({
                    dataType: 'json', 
                    contentType: 'application/json; charset=utf-8',
                    url: INSTANCE_URL + '/api/v2/user/session',
					crossDomain: true, //Added this for CORS (Doesn't work)
                    data: JSON.stringify({
                        "email": email,
                        "password": password
                    }),
                    cache:false,
                    method:'POST',
					headers: {
                        "X-DreamFactory-API-Key": APP_API_KEY
                        //"X-DreamFactory-Session-Token": token
                    },
                    success:function (response) {
                        callback(response);
                    },
                    error:function (response) {
                        callback(response);
                        return false;
                    }
                });

I am trying to log users in using this post accessing the api docs on my DreamFactory instance. When I try it locally it works fine, but when I switch over to an official instance I get blocked by a preflight request and get the following error:

XMLHttpRequest cannot load http://52.87.25.0/api/v2/user/session. Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'http://23.42.248.110, *', but only one is allowed. Origin 'http://23.42.248.110' is therefore not allowed access.

I am using Node.js and I have tried to set the response header and the npm cors package, but neither of those have seemed to make a difference.

Posts: 1

Participants: 1

Read full topic

"Batch Error" on updating records in the table

@Nishant_Soni wrote:

Hi,

I am calling the API via AJAX , When i am trying to update records in the table, all records are updating successfully, but API returns
"errorBatch Error: Not all records could be patched" with the 400 error code.

Please suggest me to solve this problem.

Posts: 1

Participants: 1

Read full topic

Passing null values in query string


Calling SQL Service Rest endpoint from custom server script not working in Node JS

@Abhishek_Panday wrote:

Hey,

Trying to fetch contents of the table in a custom script in Node JS. Below is the code

var cartId = event.request.payload.cartId;
var filter = 'cartId='+ cartId;
var related = 'cart_line_item_by_cart_id';
var options = {
'headers': {
'Content-Type': 'application/json',
'X-DreamFactory-Api-Key': '259124c07a7ad030582b8eb185431ba2bdd8265b3353b690c533c91dce4e3e08'//mock key
}
};
platform.api.get('kw2-sql-db/_table/cart', options, function(body, response) {
console.log('body' + body);
console.log('response' + response);
// this call actually has failed. mentioning the body below
});

Logs

body{"error":{"context":null,"message":"Invalid token: Wrong number of segments","code":401,"trace":["0 [internal function]: DreamFactory\Http\Middleware\AccessCheck->handle(Object(Illuminate\Http\Request), Object(Closure))","1 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","2 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","3 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","4 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","5 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","6 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9467): Illuminate\Pipeline\Pipeline->then(Object(Closure))","7 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9454): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'handleGET')","8 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8524): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'DreamFactory\\Ht...', 'handleGET')","9 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8511): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request))","10 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8225): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))","11 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","12 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","13 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","14 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","15 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8226): Illuminate\Pipeline\Pipeline->then(Object(Closure))","16 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8217): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))","17 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8207): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))","18 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))","19 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))","20 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","21 /opt/bitnami/apps/dreamfactory/htdocs/app/Http/Middleware/AuthCheck.php(183): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","22 [internal function]: DreamFactory\Http\Middleware\AuthCheck->handle(Object(Illuminate\Http\Request), Object(Closure))","23 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","24 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","25 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","26 /opt/bitnami/apps/dreamfactory/htdocs/vendor/barryvdh/laravel-cors/src/HandleCors.php(34): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","27 [internal function]: Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))","28 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","29 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","30 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","31 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17769): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","32 [internal function]: DreamFactory\Http\Middleware\FirstUserCheck->handle(Object(Illuminate\Http\Request), Object(Closure))","33 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","34 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","35 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","36 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(13474): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","37 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))","38 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","40 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","41 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(11964): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","42 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))","43 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","45 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","46 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(13213): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","47 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))","48 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","49 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","50 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","51 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(13150): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","52 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))","53 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","54 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","55 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","56 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","57 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))","58 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9963): call_user_func_array(Array, Array)","59 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))","60 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","61 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))","62 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9948): call_user_func(Object(Closure), Object(Illuminate\Http\Request))","63 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure))","64 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))","65 /opt/bitnami/apps/dreamfactory/htdocs/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))","66 {main}"]}}

There is a table called cart in the kw2-sql-db and the following rest call works from rest client
http://54.202.131.183/api/v2/kw2-sql-db/_table/cart

Also i have create a single all access role from now that allows access from both API and script

Any help would be appreciated

Posts: 1

Participants: 1

Read full topic

How to integrate React Native with Dreamfactory?

@jcalderaio wrote:

I am making an employee timesheet app in React Native for a client that must connect to their SQL server. The SQL server has tables in it such as timesheet, employee, client, and job. I'll be doing many complicated joins and other SQL functions so I figured DreamFactory would be a good way to go.

I told the IT guys to set up an account with DreamFactory and hook it up to the SQL Server, hoping I can use the created API to connect to DreamFactory.

I found the DreamFactory SDK for React.js here: https://github.com/dreamfactorysoftware/reactjs-sdk

Will this work with React Native?

Please, help me out. I am so lost. I am not too experienced in either React Native or backends, so this is kind of confusing.

Posts: 1

Participants: 1

Read full topic

Openshit Cartridge Error 503

@Paulo_Henrique_de_Si wrote:

Hi.

I'm trying to install Dreamfactory on my Openshift v2 account .
The installation is successful but when I try to access the application I get an internal server error,
the app log is as follows:

PHP Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /var/lib/openshift/58c72fc889f5cfce11000016/app-root/runtime/repo/df/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 477

I think that this is due the PHP version.Can someone help me?

Thanks.

Posts: 1

Participants: 1

Read full topic

Sometimes not able to restart mysql service using ctlscript.sh stop / start (tc.log file issue)

@armin.fraude wrote:

Hi,

I have a similar problem like described in https://community.dreamfactory.com/t/error-on-tc-log-file-when-restarting-bitnami-service/2988/4, but different boundary conditions:

The first restart of the bitnami services via /bitnami/ctlscript.sh stop / start led to the same error as discussed in the above mentioned conversation. So I simply deleted /bitnami/mysql/data/tc.log (after reading this post above) and I could restart it again.
The days after, I tested this several times and each time was successful: all services could be started.

But after 1 week working with it, the error restarting the bitnami services occurred again.

In my case, I never changed "always_wrap_resources" to false in apps/dreamfactory/htdocs/config/df.php. It's set to true from the beginning.
Neither I performed changes in other config files.
Neither I have this problem every time restarting the bitnami services.

Why do I get this error sometimes and sometimes not?
I guess this is an indication, that my bitnami installation is not running reliably?

Thank you in advance for any hint
Best Regards

Posts: 1

Participants: 1

Read full topic

Table 'dreamfactory.cors_config' doesn't exist on Fresh Installation

@sosukeinu wrote:

Hello,
I've fought and fought over the past few days trying to get DF installed as a part of a docker-compose stack. I'm using basically the same compose file that comes from the official DF github. The only real difference is that I noticed the .env file was not being created in the root directory, so I needed to create a custom entrypoint.sh that echoed my environment variables instead of using sed substitution. I get the "create a new user page" and i verify that the DB is seeded (I have no way of knowing whether it is seeded correctly), but my user is created. After that, All I get is a white page with a 500 server error, and an error in the logs that says

[2017-03-15 12:06:22] production.ALERT: Could not get cors config from DB - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dreamfactory.cors_config' doesn't exist (SQL: select * fromcors_configwhereenabled= 1)

within nginx this is the log that reports 500 error

mnginx.1 | e[0mdreamfactory.app 172.22.0.1 - - [15/Mar/2017:12:10:57 +0000] "GET /api/v2/system/environment HTTP/1.1" 500 134 "http://dreamfactory.app/dreamfactory/dist/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"

Any help of direction would be greatly appreciated.

Posts: 1

Participants: 1

Read full topic

Viewing all 1524 articles
Browse latest View live