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

Connecting to DreamFactory from a remote server

$
0
0

@nonlinearmind wrote:

I have DreamFactory up an running and want to use it solely to house a database and handle api calls to that database from a webserver on another domain. I’ve set up CORS in DF with *, but am still getting the error that my domain “is not allowed by Access-Control-Allow-Origin”.

I’ve been googling and searching the forum, but have yet to find a solution. How can I make API calls from my site on another server?

Posts: 1

Participants: 1

Read full topic


How to local files in webhosting?

$
0
0

@MD_Kamal_Hossain_Sha wrote:

I did installed bitnami free version. I want to uplaod it in my cPanel web hosting how to do it … if I transfer the database there and upload the files of local app folder in the hosting site will that be enough?

Posts: 1

Participants: 1

Read full topic

Retrieving by date

$
0
0

@Sidlegionair wrote:

Hi,

I’m using PHP to filter from a mongodb database and everything seems to work, except when I want to retrieve a date record from it.
PHP code:
$filterstring .= " AND (createdAt < ".date_format(DateTime::createFromFormat("d/m/Y", $filtervalue), "Y-m-d H:i:s")." )";

Then I use the $filterstring variable as $params[‘filter’] and send $params to the $api->get() method as the second parameter.

How a record’s date field looks:

“createdAt”:{"$date":“2017-12-27T18:18:15+00:00”}

how do I go about filtering these dates from PHP

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Admin panel of DreamFactory under the Service adding tab Cache service causes this error regardless of which type of cache I choose (memcached, array, or file)

$
0
0

@Huseyin_Naci_LACIN wrote:

Hi ;
I have a fresh installation of dreamfactory-2.10.0. I try to add cache service. But I got an error

The server return an unknown error.

When I check the console of browser I got the error

POST http://dream.fieldrec.net/api/v2/system/service?fields=*&related=service_doc_by_service_id 500 (Internal Server Error)

code: 400,
context: null,
message: “No session token (JWT) or API Key detected in request. Please send in X-DreamFactory-Session-Token and/or X-Dreamfactory-API-Key request header. You can also use URL query parameters session_token and/or api_key.”,

Admin panel of DreamFactory under the Service adding tab Cache service causes this error regardless of which type of cache I choose (memcached, array, or file)

Thanks in advance

Posts: 2

Participants: 1

Read full topic

Email API can't use Global Look Up Keys

$
0
0

@Dafuallah_Esameldien wrote:

Hello, I’m trying to use Global Look Up Keys for Email API, stmp config and it will not work.

To call the Global Look Up Key, I used {email_host} for the host, and has been assigned already in the Global Look Up Key. Yet, doesn’t work. Any work around on this?

Posts: 1

Participants: 1

Read full topic

Dead DF Instance on GCE After Reboot and IP Change

$
0
0

@Patrick_Eidemiller wrote:

After a reboot and an IP change (shame on me for not setting static IP) Dream Factory sticks at the log in screen and pressing the log in button has no effect.

This was a stock Bitnam install and no changes were made to the environment. We are getting an error in the logs as:

[2018-01-22 20:31:18] local.ALERT: Could not get cors config from DB - SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from cors_config where enabled = 1)
[2018-01-22 20:31:18] local.ERROR: PDOException: SQLSTATE[HY000] [2002] No such file or directory in /opt/bitnami/apps/dreamfactory/htdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
Got above error from below file -
/home/yogesh_pa_25/apps/dreamfactory/htdocs/storage/logs/dreamfactory.log

Its unclear if this error is originating from an API call connected to a database that was whitelisted after the log was fetched, or if this is related to the dead log in.

Tried restarting services from command line. No Joy.
Tried reboot. No Joy.

Posts: 1

Participants: 1

Read full topic

Dreamfactory Services Listing Page Dropdown Sometimes Only Shows Page 1

$
0
0

@Anson_Hwa wrote:

The dropdown only shows page 1 eventhough my services list more than 1 page. We need to refresh page or click on other tab then click back services tab only manage to see the page 2 and so on.

Posts: 1

Participants: 1

Read full topic

Import Package Overwrite Not Working

$
0
0

@Anson_Hwa wrote:

I am able to export the services that I want, it is great! but when i try to import and replace the existing services, it not able to overwrite the existing services. I need to delete all existing services if to be import package have the same services name. The tick button on overwrite existing not working fine.

Posts: 1

Participants: 1

Read full topic


Call to a member function beginTransaction() on null

$
0
0

@ollielowson wrote:

Hi,

I am having some trouble deploying a custom API based on a PHP script: the script works once, then on subsequent calls fails with an exception, until I clear the Dreamfactory cache.

The script with problems:

  1. Receives a JSON document that refers to several different related tables, in a custom format
  2. Parses this JSON to extract the data that we need
  3. Generates a resource to submit through an internal API call to Dreamfactory, including related data - using the XX_by_XXID notation as per the documentation: Related Data
  4. Submits the resource in a transaction, i.e. with rollback=true

So far I have tried:

  • Using my script to generate the resource and submitting this manually through the API docs - this works
  • Reinstalling Dreamfactory - this seemed to work, but I came in the next day and the issue was back
  • Changing from MariaDB to MySQL-5.7 - this made no difference

When I check the MySQL logs, I am seeing no second attempt to submit the request (which would make sense, given that the error implies that the connection has gone away).

I am running out of ideas, has anyone else come across this issue?

Many thanks,

Ollie

Posts: 1

Participants: 1

Read full topic

No 'Access-Control-Allow-Origin' header is present on the requested resource

$
0
0

@drexelsharp wrote:

DreamFactory Version: 2.11.0

trying to open CORS up to allow everything for development. I’ve added an asterisk on Path, Origins, Headers. Selected all methods. checked Enabled and Supports Credentials.

I am still receiving CORS related errors.
No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:4200’ is therefore not allowed access.

I had a previous version of Dreamfactory and I did not have this issue. I just created this instance in google cloud and I cannot resolve this issue.

Has anybody else had this issue and resolved it?

Posts: 1

Participants: 1

Read full topic

Bug: event scripts linked to local file service do not get executed (V2.10)

$
0
0

@jps wrote:

In version 2.10, there is a very useful feature that suggests we can now host event scripts on the file system, by linking the scripts to a file service.

I created a new file service for this purpose, pointed it to a folder under ‘storage’ and gave it a name of a script file. It managed to read the script and show it in the console when I clicked “view latest”. However, the script is never executed, even though it’s saved, set to active. Clearing the cache did not resolve this.
: When saving the script, the loaded script disappears. Not sure if this is by design.

Also, the number of characters allowed in the filename is limited. Suggestion: increase the number of characters allowed and default to the script name as shown in the console. This way, script files can be easily traces back to the relevant endpoint and method.

Posts: 1

Participants: 1

Read full topic

Hosting in shared hosting

$
0
0

@MD_Kamal_Hossain_Sha wrote:

Can anyone help me. which files and lines I have to edit to host dreamfactory in a shared hosting?
n.b I dont have sudo access to my hosting cli.

Posts: 2

Participants: 2

Read full topic

File permission for access_log and error_log

$
0
0

@mrbijan wrote:

Hi,
I accidentally deleted the two files and now nothing gets logged. I tried recreating the files, but still nothing gets logged.
Can someone tell me what the file permissions for those two files are?

Thanks a lot.

Posts: 1

Participants: 1

Read full topic

How to enable Graphql?

$
0
0

@mdamaceno wrote:

According to this post, Dreamfactory has support for Facebook’s GraphQL (beta). How could I enable this feature on dashboard? I can’t see anything related to it on dashboard.

Note: I got Dreamfactory from Github.

Posts: 1

Participants: 1

Read full topic

Request Payload modification

$
0
0

@Hussain_Fakhruddin wrote:

Hi, We had many scripts which were allowing to modify the payload. Running fine.

Then we upgraded to the latest version 2.11.0

In this every modification of payload is not working. All per-scripts are breaking due to this.

For example,we’re modifying :
$event[‘request’][‘payload’][‘password’] in PRE SCRIPT.
The script doesn’t take this and post also shows old values from the request.

Any quick help would be highly appreciated. If its a bug, would like to know a quick fix file so that we can go and fix it.

Posts: 2

Participants: 2

Read full topic


Swagger question

$
0
0

@David_Kachlon wrote:

'm trying to create my own REST API with Swagger, Postman, and DreamFactory - I create a JSONv1 file from POSTMAN and exported it to Swagger as a YAML - Then from swagger, I created a package. I tried using the index.js file as the config in dreamfactory, but there are no functions in it that actually perform operations on the data - there are 4 subdirectory .js files in my package. I’m not sure waht they do, I beleive they are what I’m looking for, some say authorize etc… My question is this - is there somesort of node.js script generator that will actually perform the operations in the script? or do i need to create my own fileOr, if someone can explain to me how to ouse these .js in the subdirectories with dreamfactory

Posts: 1

Participants: 1

Read full topic

Dream factory login failed

$
0
0

@Victoria_Dimitrova wrote:

Hi,

Previously I install dream factory at my local machine in order to make some demostration of the technology.
After one months I retry to go back and log into the administration interface, but it is not yet possible.
Before only the user and the password fields appears into the login page. Now there is OAuth and SAML parts that are shown.

I inspect the console errors, and there is a lot of errors like :

Is there someone having an idea ?
Thanks

Posts: 1

Participants: 1

Read full topic

Landing page after email verification

$
0
0

@Bill_Simon wrote:

Hi,

I am implementing the email verification and password reset feature for my application using DF.

I wonder if there is way to configure the landing page after user clicking the linking and successfully completed the verification and email reset? Currently, DF will by default log the user in. Instead, it’d be more appropriate for my application to show a simple confirmation page that the process has been.

Is this possible and how to do so?

Thank you very much for your advise.

Bill

Posts: 1

Participants: 1

Read full topic

Script platform.api.get Not Getting Data From Table

$
0
0

@jmpreston wrote:

This function isn’t retrieving the data from the database. Details below.

function getSkillRecord(id) {
  var url = 'pfcrud/_table/skills/' + id;

  return new Promise(function (resolve, reject) {
    platform.api.get(url, null, function (body, response) {
      var result = JSON.parse(body);
      console.log('result: ', result);
      if (result !== "" || result !== null) {
        resolve(result.skill_name);
      } else {
        reject(Error("Fetch from database failed."));
      }
    })});
}

This code lives in the Scripts tab with this process:
myService._table.purchaseOrders.get.post_process

Local install in Vagrant Ubuntu 16.04 box with Postgres 9.5 and DF 2.9.0.

A function above the first one loops through an array of item ids in a Postgres field, creates an array like: idArray = [11, 12, 14] and record = allRecords[i]. It then assigns values to the two parameters in this function. That works fine as does the function below, getItemNames(). I tested getItemNames with a fake db array of objects on the page. The Postgres table has columns for item_id and item_name, as does my fake db table.

The problem is in the getItemRecord(id) that uses the DF Node.js API in the Scripts tab. It is supposed to fetch the item object by its id from the items table and then I assign the item_name to a var to pass to the calling function. The commented function below it works fine for tests so I’ve isolated the problem to the DF API setup. I followed the official docs as best I could.

I’m logged in as Admin and have Roles for the tables set to Api, Script.

I include promises for async, but I’m new to all of this and not sure I’m using them correctly.

Any ideas?

// Everything in this function works fine in tests.  The problem is below.
// Called from for loop above.
// Process the idArray to extract item_name's from items table.
// Includes getItemRecord() to retrieve each item name from the db.
function getItemNames(record, idArray) {
  
  var item_names = [];
  var itemName;
  var id;

  
  return new Promise(function (resolve, reject) {
      for (var i = 0; i < idArray.length; i++) {
        
        id = idArray[i];
          
        if (id !== null) {
            
            // Get the record for this id.
            itemName = getItemRecord(id); // This works if accessing a local var fake db.
            
            // Creates an array of item names for member. Works perfect in tests.
            resolve(item_names.push(itemName));
          } else {
            reject(Error("Item names parse failed."));
          }
        }
        
    // Last step to complete the replacement of item id's with item names for a record.
    // This changes the json sent to the UI.
    record.item_id_array = item_names;
  });
}



// This fails to retrieve records.  The commented function below works.

function getItemRecord(id) {
    var url = 'myService/_table/items/' + id;

    return new Promise(function (resolve, reject) {
        platform.api.get(url, null, function (body, response) {
            var result = JSON.parse(body);
            if (result !== "" || result !== null) {
                resolve(result.item_name);
            } else {
                reject(Error("Fetch from database failed."));
            }
    })});
}


/*  This works for retrieving records from a local var fake db.
function getItemRecord(id) {
    var dbRecord = fakeDB.find(function (dbRecord) { return dbRecord.item_id === id; });
    return dbRecord.item_name;
}
*/

Posts: 1

Participants: 1

Read full topic

How to run Dreamfactory to achieve HA

$
0
0

@Madhu_N wrote:

Hi All,

I have planned to run multiple dream-factory servers to achieve High availability and
I have been using Remote hybrid database servers for my application(MySQL and MongoDB).

Could somebody please give some tips or more information to architect my application for production environment. - I am confused to design my application architecture.
App built in (framework used-Angular 2,DB - (Mysql and mongodb), AWS cloud.

Thanks in Advance.

Best Regards
Madhu

Posts: 4

Participants: 2

Read full topic

Viewing all 1522 articles
Browse latest View live