Quantcast
Channel: DreamFactory Forum - Latest topics
Viewing all 1524 articles
Browse latest View live

Dreamfactory doesn't recognize defined params in database functions

$
0
0

@armin.fraude wrote:

Hi,

my problem is, that I can't pass parameters from my ExtJs application to my defined functions in the database (postgreSQL).
I found several solutions in internet how to send the params to dreamfactory, but none of them functions.

I always get a 500 Response, that the handedover params don't fit their definition in the database.

If I call /api/v2/db/_func?ids=functionname in Postman for example I get the following result:
{
"resource": [
{
"alias": null,
"name": "functionname",
"label": "functionname",
"description": null,
"native": [],
"return_type": "integer",
"return_schema": [],
"params": [],
"access": 31
}
]
}

So here I can see, that according to dreamfactory it don't even exist parameters.
But they are defined in the definition of the functions in the database and all worked correctly when I was using Dreamfactory 1.9. I recently updated to Dreamfactory 2.4.2.

How is it, that I have this error?
What must I do, that this works correctly?
Thank you in advance for any hint.
Best regards

Posts: 1

Participants: 1

Read full topic


Problem to access DreamFactory APIs from PostMan(Google Chrome Client)

$
0
0

@eduardo wrote:

Hi,

I'm trying to consume the DreamFactory server services, but still unsuccessful.

I followed several posts of similar problems and tutorials, but I continue with the problem.

I've created a service that sends email using my Google account. Inside the DF server (PHPAdmin), it works, but I want to test the service through PostMan and it shows the error 403 (Forbidden)



http://wiki.dreamfactory.com/DreamFactory/API#API_Key

http://www.iminfo.in/post/post-json-postman-rest-client-chrome

Steps I've already taken:
1) Enabled CORS

2)Create an APP

3) Create a Role

4) Create User and Confi Role

5) Work fine in Server

6) Problem in PostMan - Without Api Key

7) Problem in PostMan - With Api Key

Posts: 1

Participants: 1

Read full topic

Python requests in DreamFactory return JSON won't display at Postman

Python server scripting with request list parameter cannot get to work

$
0
0

@kalmenchia wrote:

Hi, i have this http:///api/v2/my_api_product/GetQcStatus?SkuSellerList=['123']

as we can see from the URL above , where the get parameter is SkuSellerList=['123']
now,

# get query params from request
req_params = event.request.parameters;
if req_params.get("SkuSellerList"):
    return json_loads_byteified( req_params.get("SkuSellerList")) ;

the above code will return the value of the SkuSellerList , it WILL work when the
parameter is NOT STRING LIST , i.e. [123,111,34] ,

but when it is ['123','111'.'34'] it won't work , neither will ["123","111","34"] , single quote , double quote SAME result , it won't work.

and if i put the parameter[""SkuSellerList""] as [123,E123] ,
it will return error as follow ,

{
  "error": {
    "context": null,
    "message": "No JSON object could be decoded",
    "code": 500
  }
}

i have also tried , urllib.urlencode() it , it just won't work. can some one point me to the correct way of handling this parameter ?

Thanks,
Kalmen

Posts: 1

Participants: 1

Read full topic

Grouping broken in version 2.5, had to rollback upgrade

$
0
0

@jps wrote:

Grouping used to work in previous versions, but it's broken in version 2.5. Managed to reproduce this on a clean Bitnami image by creating a simple table "test" in MySQL with two columns: id and test_name.

When trying to get records, grouped by test_name using this:
https://<host_name>/api/v2/mysql/_table/test?fields=test_name&group=test_name
I now get this result:

{
  "error": {
    "code": 500,
    "context": null,
    "message": "Failed to retrieve records from 'test'.\nstrpos() expects parameter 1 to be string, array given",
    "trace": [
      "0 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-database/src/Resources/BaseDbTableResource.php(460): DreamFactory\\Core\\SqlDb\\Resources\\Table->retrieveRecordsByFilter('test', NULL, Array, Array)",

The problem appears whenever I add the "group" parameter.

Posts: 1

Participants: 1

Read full topic

How can I get response headers from platform.api.post call?

$
0
0

@lovenalube wrote:

Hello

I have a line like this in a server side V8js post process script:

var result = platform.api.post("http://example.com/my_api", JSON.stringify({"name":"test"}), options);

How can I get the response headers? Trying to do var_dump(result) does not give the response headers.

Posts: 1

Participants: 1

Read full topic

Could not open input file: artisan during 2nd install of df2

$
0
0

@jmpreston wrote:

I ran 'php artisan dreamfactory:setup' for the first step of the manual installation on Ubuntu 16.04 with PHP7 and it seemed to work well except for 2 problems with the mongodb requirements and php-mongo versioning. What little I found on the Web seemed to say to ignore that.

So I ran 'php artisan dreamfactory:setup' again for the second stage of setup and now I get an error: 'Could not open input file: artisan'.

I'm in the same directory for setting up all the dependences. Nothing has changed from the first time it ran except I selected sqlite instead of MySQL or MariaDB for the settings DB. I have installed Mongo because I read elsewhere that Mongo is required. (Very confusing instructions!)

These are the instructions and I'm doing the manual install. Bitnami is not an option. I'm in Step 4 of the DreamFactory section, second part. http://wiki.dreamfactory.com/DreamFactory/APT/Ubuntu_16.04/Installation

Posts: 1

Participants: 1

Read full topic

POST file with metadata

$
0
0

@schoel wrote:

Hi,

Your API docs seem to indicate that I can attach metadata to files that I upload to DSP. I just cannot figure out how to do that. In POST /files/{file_path} it says the schema for the body is:

{
  "name": "string",
  "path": "string",
  "content_type": "string",
  "metadata": [
    "string"
  ]
}

But where does the file content go in this case? On the other hand, I can post the file contents directly, but how do I attach metadata then?

As an example often explains things best, could you give me a plain but complete HTTP request (as opposed to a PHP/JavaScript/whatever API call) that would do the following:

  • uploads file foo.txt
  • with content type text/plain
  • and content "Foo Bar Baz"
  • as well as metadata item "bar=baz"

Thanks.

Posts: 2

Participants: 2

Read full topic


Advice on improving stability?

$
0
0

@EM_FLK wrote:

Our Dreamfactory, installed with the bitami installer, is freezing, crashing and suffering slow downs constantly. We have attempted restarting and a fresh install but the issues persist.

We were wondering if anyone had any advice or solutions that they themselves had come up with the improve performance and/or stability.

Many Thanks.

Posts: 1

Participants: 1

Read full topic

Service isn't requiring login to access

$
0
0

@Tyler_Cox wrote:

I have a service that is allowing access without actually handing off a token value. How do I fix this? It acts like it doesn't allow guest access if I don't add in the authentication type header, but if I hand it that header without the token it just doesn't care.

curl -X GET --header "Accept: application/json" --header "X-DreamFactory-Api-Key: 36fda24fe5588fa4285ac6c6c2fdfbdb6b6bc9834699774c9bf777f706d05a88" --header "Authorization: Basic ekBnLmNvbTphYmMxMjM=" http://localhost:8082/api/v2/jfani_db/_schema

Returns:

{"resource":[{"name":"clients"},{"name":"Collateral"},{"name":"Contracts"},{"name":"debts"},{"name":"LoanPackageHistory"},{"name":"Loans"},{"name":"Notes"},{"name":"Packages"},{"name":"Payments"},{"name":"Tasks"}]}

while

curl -X GET --header "Accept: application/json" --header "X-DreamFactory-Api-Key: 36fda24fe5588fa4285ac6c6c2fdfbdb6b6bc9834699774c9bf777f706d05a88" http://localhost:8082/api/v2/jfani_db/_schema

returns:

{"error":{"context":null,"message":"No session token (JWT) provided. Please provide a valid JWT using X-DreamFactory-Session-Token request header or 'session_token' url query parameter.","code":400}}

Like it is supposed to. The first example should be returning this same value because there is no valid token being passed.

Posts: 3

Participants: 1

Read full topic

Copy user data upon registering

$
0
0

@Gavin_Beard wrote:

Good day

I am trying to find out if it is possible to have DreamFactory copy user details to another Mysql database when a user registers?

I have a mysql db running in AWS ( which is setup as a service in DF) and when a user registers, I also want some of the users details to get stored in my AWS db for some reporting functionality.

I thought maybe at first I could just use a Federated table within Mysql within AWS doesn't support this so I am just looking for an alternative solution.

Any help is appreciated

Gavin

Posts: 7

Participants: 2

Read full topic

Import package from version to version

$
0
0

@pascal_b wrote:

From:
Admin Application Version: 2.5.1 - DreamFactory Version: 2.4.2
To:
Admin Application Version: 2.6.0 - DreamFactory Version: 2.5.0

I got this error when importing export zip package ... :

{,…}
error
:
{code: 401, context: null, message: "Invalid token: Token Signature could not be verified.",…}
code
:
401
contex
:
null
message
:
"Invalid token: Token Signature could not be verified."
status_code
:
400
trace
:
[,…]
0
:
"0 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): DreamFactory\Core\Http\Middleware\AccessCheck->handle(Object(Illuminate\Http\Request), Object(Closure))"
1
:
"1 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))"
2
:
"2 /var/www/vhosts/example.com/dreamfactory/vendor/dreamfactory/df-core/src/Http/Middleware/AuthCheck.php(220): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
3
:
"3 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): DreamFactory\Core\Http\Middleware\AuthCheck->handle(Object(Illuminate\Http\Request), Object(Closure))"
4
:
"4 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))"
5
:
"5 /var/www/vhosts/example.com/dreamfactory/vendor/barryvdh/laravel-cors/src/HandleCors.php(34): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
6
:
"6 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))"
7
:
"7 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))"
8
:
"8 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
9
:
"9 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Router.php(561): Illuminate\Pipeline\Pipeline->then(Object(Closure))"
10
:
"10 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Router.php(520): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))"
11
:
"11 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Router.php(498): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))"
12
:
"12 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(174): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))"
13
:
"13 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))"
14
:
"14 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
15
:
"15 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))"
16
:
"16 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))"
17
:
"17 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
18
:
"18 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))"
19
:
"19 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))"
20
:
"20 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))"
21
:
"21 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))"
22
:
"22 /var/www/vhosts/example.com/dreamfactory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))"
23
:
"23 /var/www/vhosts/example.com/dreamfactory/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))"
24
:
"24 {main}"

Any idea ?

Posts: 1

Participants: 1

Read full topic

Using stored procedures on MySQL version < 5.5.3

$
0
0

@efunneko wrote:

I am trying to call a stored procedure on mysql version 5.0.77. When I try to do a simple call of the procedure, I get the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'DATA_TYPE' in 'field list' (SQL: SELECT ROUTINE_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = :type AND ROUTINE_SCHEMA = :schema)",

I believe that this is because my version of MySQL does not have the column 'DATA_TYPE' in the ROUTINES table. Is there anyway to get around this? I need to use procedures to fulfill my application's needs and upgrading the DB is not an easy option right now.

Posts: 3

Participants: 1

Read full topic

Docs error? Is JSON.stringify not needed for POST in V8?

$
0
0

@Konrad wrote:

HI, I spent some time trying to figure out why my POST request does not work in a V8 event script. Turned out I didn't need to do JSON.serialize on payload object, just pass it 'as is'. In the docs examples here a POST example in V8 serializes the payload, but in Node.js it doesn't. Serializing the payload gave me :

"No record(s) detected in request. Please make sure record(s) are wrapped in a 'resource' tag.

Is the V8 example wrong or am I missing something?

Posts: 1

Participants: 1

Read full topic

User/register not being called

$
0
0

@Konrad wrote:

Hi,

I'm trying to create user profile in my main app mysql db after registering a new user. If I'm not terribly mistaken I saw POST user/register endpoint being called after logging in with OAuth if the user was not in the users table already - which makes sense.

Can anyone please correct me?
1. POST user/register should be called when I log in for the first time with a email/OAuth service combination (eg. johnbgoode@gmeail.dev via FB). Correct?
2. If I delete the user manually via DF Admin Panel #/users tab and then repeat the pt 1 process - DF should treat it as a brand new user registering and call POST user/register again?

However ATM I can't confirm POST user/register is being called at all even in the first case (brand new FB Test User used) so I need to know at least what the 'expected result' shoud be. :slight_smile:

Posts: 1

Participants: 1

Read full topic


Power Query (M) pulling multiple pages

$
0
0

@jraiche wrote:

This PowerQuery/M code automatically grabs multiple pages of dreamfactory JSON recursively. The column will still need to be expanded, etc, as usual.

Improvements welcome, I'm by no means a powerquery expert, but I wanted to get dreamfactory working with PowerBI. While this is tailored to dreamfactory, it should work with any paged api.

let getDFUrl = (url as text, optional previousResult) =>
        let
			Res = Json.Document(Web.Contents(url)),
			offset = 
                            try Res[meta][next]
                            otherwise 0,
			combination = if (previousResult <> null) then
				Table.Combine({
					previousResult,
					Table.FromList(Res[resource], Splitter.SplitByNothing(), null, null, ExtraValues.Error)
				})
			else
				Table.FromList(Res[resource], Splitter.SplitByNothing(), null, null, ExtraValues.Error),
			
			Result = 
                            if (offset <> null) then
                                if (offset > 0) then 
					@getDFUrl(url & "&offset=" & Number.ToText(offset), combination) 
				else 
					combination
                            else
                                "nothing..."
        in Result
in getDFUrl("your_dreamfactory_url_with_filters_and_api_key_and_stuff")

This query seems to have issues in Excel at the moment, but PowerBI is working fine.

Posts: 1

Participants: 1

Read full topic

Integrating AngularJs 1.5.7 Api with Dream Factory

$
0
0

@pritam.maiti wrote:

I am developing an Admin Panel in AngularJs whose apis are coming from Dream Factory.But when i am trying $http.get or post to call api url that time i am getting error

XMLHttpRequest cannot load http://localhost:8080/api/v2/mysql/_table/contact?include_count=true&limit=15&offset=0&order=last_name+ASC. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 403.

Then i try jsonp.In jsonp the above error is not comming but i am geting a different error

Uncaught SyntaxError: Unexpected token :

I have implemented your own angular-sdk-master.But still getting the first error.

Please let me know how i will solve this error.

Posts: 1

Participants: 1

Read full topic

Facebook login fails

$
0
0

@rbarriuso wrote:

Hi all,

I'm not sure if Facebook Oauth is down but currently we can't authenticate users against our DF v2.2.1 via Facebook.
The DF server response is the following:

{"error":{"context":null,"message":"","code":500,"trace":["0 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-oauth/src/Services/BaseOAuthService.php(91): Laravel\\Socialite\\Two\\AbstractProvider->user()","1 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Resources/UserSessionResource.php(85): DreamFactory\\Core\\OAuth\\Services\\BaseOAuthService->handleOAuthCallback()","2 [internal function]: DreamFactory\\Core\\Resources\\UserSessionResource->handlePOST()","3 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(268): call_user_func(Array)","4 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(174): DreamFactory\\Core\\Components\\RestHandler->processRequest()","5 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(221): DreamFactory\\Core\\Components\\RestHandler->handleRequest(Object(DreamFactory\\Core\\Utility\\ServiceRequest), '')","6 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(169): DreamFactory\\Core\\Components\\RestHandler->handleResource(Array)","7 /opt/bitnami/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Services/BaseRestService.php(75): DreamFactory\\Core\\Components\\RestHandler->handleRequest(Object(DreamFactory\\Core\\Utility\\ServiceRequest), 'session')","8 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17089): DreamFactory\\Core\\Services\\BaseRestService->handleRequest(Object(DreamFactory\\Core\\Utility\\ServiceRequest), 'session')","9 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17061): DreamFactory\\Http\\Controllers\\RestController->handleService('v2', 'user', 'session')","10 [internal function]: DreamFactory\\Http\\Controllers\\RestController->handlePOST('v2', 'user', 'session')","11 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9132): call_user_func_array(Array, Array)","12 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9194): Illuminate\\Routing\\Controller->callAction('handlePOST', Array)","13 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9174): Illuminate\\Routing\\ControllerDispatcher->call(Object(DreamFactory\\Http\\Controllers\\RestController), Object(Illuminate\\Routing\\Route), 'handlePOST')","14 [internal function]: Illuminate\\Routing\\ControllerDispatcher->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","15 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","16 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17266): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","17 [internal function]: DreamFactory\\Http\\Middleware\\AccessCheck->handle(Object(Illuminate\\Http\\Request), Object(Closure))","18 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","19 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","20 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","21 [internal function]: Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","22 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9651): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","23 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9175): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))","24 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9162): Illuminate\\Routing\\ControllerDispatcher->callWithinStack(Object(DreamFactory\\Http\\Controllers\\RestController), Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'handlePOST')","25 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8230): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'DreamFactory\\\\Ht...', 'handlePOST')","26 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8217): Illuminate\\Routing\\Route->runController(Object(Illuminate\\Http\\Request))","27 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7931): Illuminate\\Routing\\Route->run(Object(Illuminate\\Http\\Request))","28 [internal function]: Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","29 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","30 [internal function]: Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","31 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9651): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","32 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7932): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))","33 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7923): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))","34 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7913): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))","35 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2419): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))","36 [internal function]: Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))","37 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","38 /opt/bitnami/apps/dreamfactory/htdocs/app/Http/Middleware/AuthCheck.php(183): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","39 [internal function]: DreamFactory\\Http\\Middleware\\AuthCheck->handle(Object(Illuminate\\Http\\Request), Object(Closure))","40 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","41 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","42 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","43 /opt/bitnami/apps/dreamfactory/htdocs/vendor/barryvdh/laravel-cors/src/HandleCors.php(42): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","44 [internal function]: Barryvdh\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))","45 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","46 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","47 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","48 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17368): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","49 [internal function]: DreamFactory\\Http\\Middleware\\FirstUserCheck->handle(Object(Illuminate\\Http\\Request), Object(Closure))","50 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","51 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","52 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","53 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(13113): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","54 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))","55 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","56 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","57 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","58 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(11656): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","59 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))","60 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","61 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","62 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","63 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12852): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","64 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))","65 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","66 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","67 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","68 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12789): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","69 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))","70 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","71 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","72 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","73 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(3286): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","74 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))","75 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9666): call_user_func_array(Array, Array)","76 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","77 /opt/bitnami/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","78 [internal function]: Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))","79 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9651): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","80 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2366): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))","81 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2350): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))","82 /opt/bitnami/apps/dreamfactory/htdocs/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))","83 {main}"]}}

It has been working fine until today.

Any idea about what the problem might be?

Posts: 2

Participants: 1

Read full topic

Call remote Services from dreamFactoty

$
0
0

@Vikas_Choubey wrote:

I have installed dreamFactory in linux server and i am trying to call
remote services from dreamfactory. i have follow the documentation on
dreamfactory . Acccording to document i have created App , Users , Roles ,
Services . I**n Services section i have call remote url then**
remote service not responding.
I have 5 web server X.X.X.4, X.X.X.5 , X.X.X.8, X.X.X.9 and X.X.X.12 and on X.X.X.12 webserver i have installed dreamFactory and X.X.X.4 is load balancer , All web server can access through VPN only .
Please let me know any way to resolve this issue through dreamFactory.

Posts: 1

Participants: 1

Read full topic

500 Error (Python script)

$
0
0

@Gavin_Beard wrote:

Hello all,

I am having some issues with a script:

import bunch

# set up headers
options = {}
options['headers'] = {}
options['headers']['X-DreamFactory-Api-Key'] = platform.session.api_key
options['headers']['X-DreamFactory-Session-Token'] = platform.session.session_token
# get records using internal URL; call api.get on the user session that was just 
# created (this script will only work in post process!)

url = 'user/session'
result = platform.api.get(url)
data = result.read()

jsonData = bunchify(json.loads(data))

if 'error' in jsonData:
	raise ValueError(jsonData.error.message)
	
# save the data from api.get on user/session to local variables
UserId = str(jsonData.id)
Firstname = jsonData.first_name
Lastname = jsonData.last_name
DisplayName = jsonData.name
Email = jsonData.email

# create a simple json object that will be inserted into the custom user data table
post_data = '{"resource": [{"user_oid": ' + UserId + ',"first_name": "' + Firstname + '","last_name": "' + Lastname + '","display_name": "' + DisplayName + '","email_address": "' + Email + '","created_date": "' + '2017-01-01' + '"}]}'

# create a record using internal URL; call api.post with the post data that was built above, data will
#  be posted to custom dim_user table

url = 'aws/_table/dim_users?fields=*&id_field=user_oid'
result = platform.api.post(url, post_data)

data = result.read()

jsonData = bunchify(json.loads(data))


if 'error' in jsonData:
	raise ValueError(jsonData.error.message)
elif 'resource' not in jsonData or len(jsonData.resource) != 1:
	raise ValueError('Unexpected response from url = ' + url)
	
print "fini"

It never reaches the end of the script, when I check the logs I see:

[2017-04-05 11:40:01] local.DEBUG: [REQUEST] {"Parameters":"{\"login\":\"true\",\"id_field\":\"user_oid\"}","API Key":"xxx","JWT":null}
[2017-04-05 11:40:01] local.DEBUG: API event handled: user.register.post.pre_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: user.register.post.post_process
[2017-04-05 11:40:01] local.DEBUG: script token: 58e4d791529e7
[2017-04-05 11:40:01] local.DEBUG: script token cache: Array
(
    [app_id] => 4
    [user_id] => 36
)

[2017-04-05 11:40:01] local.INFO: [REQUEST] {"API Version":"2.0","Method":"GET","Service":"user","Resource":"session"}
[2017-04-05 11:40:01] local.DEBUG: [REQUEST] {"Parameters":"[]","API Key":null,"JWT":null}
[2017-04-05 11:40:01] local.DEBUG: API event handled: user.session.get.pre_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: user.session.get.post_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: user.session.get.queued
[2017-04-05 11:40:01] local.INFO: [RESPONSE] {"Status Code":200,"Content-Type":"application/json"}
[2017-04-05 11:40:01] local.DEBUG: script token: 58e4d791529e7
[2017-04-05 11:40:01] local.DEBUG: script token cache: Array
(
    [app_id] => 4
    [user_id] => 36
)

[2017-04-05 11:40:01] local.INFO: [REQUEST] {"API Version":"2.0","Method":"POST","Service":"aws","Resource":"_table/dim_users"}
[2017-04-05 11:40:01] local.DEBUG: [REQUEST] {"Parameters":"{\"fields\":\"*\",\"id_field\":\"user_oid\"}","API Key":null,"JWT":null}
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.{table_name}.post.pre_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.dim_users.post.pre_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.{table_name}.post.post_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.dim_users.post.post_process
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.{table_name}.post.queued
[2017-04-05 11:40:01] local.DEBUG: API event handled: evvntlyaws._table.dim_users.post.queued
[2017-04-05 11:40:01] local.INFO: [RESPONSE] {"Status Code":500,"Content-Type":"application/json"}
[2017-04-05 11:40:01] local.INFO: Script 'user.register.post.post_process' output:

POST
{"resource": [{"user_id": 36,"first_name": "test","last_name": "user40","display_name": "test user40","email_address": "test40@junkmail.com","created_date": "2017-01-01"}]}


[2017-04-05 11:40:01] local.DEBUG: API event handled: user.register.post.queued
[2017-04-05 11:40:01] local.INFO: [RESPONSE] {"Status Code":200,"Content-Type":"application/json"}

I see that the there is an error 500 from the post to the aws table. If i take the POST output that I'm printing and use it in API docs then it inserts without an issue. I can't figure out how to find what the 500 error is from a Python script, and can't see anything that should cause an issue in the script?

Any help is appreciated

Posts: 1

Participants: 1

Read full topic

Viewing all 1524 articles
Browse latest View live