Platform.api.post("user/session",{}) is broken after updating from DF 2.0.1 -> DF 2.0.4


#1

Hi,

After updating to DF 2.0.4 the server side scripts will fail when calling platform.api.post(“user/session”,{}).

How to replicate: I created a service test1 that will execute this:

var param = {"email": "test1@bitperbit.info", "password": "test1","remember_me": true, "duration": 64000};
var res_login = platform.api.post("user/session",param);
event.response = res_login ;
return;

This will return an 500 Internal Server Error, with this message:

<span class="exception_title">
	<abbr title="Symfony\Component\Debug\Exception\FatalErrorException">FatalErrorException</abbr> in 
	<a title="/home/bitnami/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/app/Http/Middleware/AuthCheck.php line 29" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">AuthCheck.php line 29</a>:
</span>
<span class="exception_message">Call to a member function query() on a non-object</span>

</h2>
<div class="block">
<ol class="traces list_exception">
	<li> in 
		<a title="/home/bitnami/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/app/Http/Middleware/AuthCheck.php line 29" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">AuthCheck.php line 29</a>
	</li>

</ol>
</div>

This i happening only on custom serverside script. If you make direct calls to “api/v2/user/session” with the API Docs or via Postman it works. It seems to be broken only on scripts.

Does anyone has the same issue? I’m hoping for quick workaround, this issue has broken my login.
I have filed a bug-fix request here.

Thanks
Gabriel


#2

Hi @bitperbit,

Same problem here, I tested in 2.02 and 2.04.


#3

Confirmed this bug. I have filed it with the dev team.


#4

Hi @drewpearce,

Did u know some workaround for this problem and/or a date for when this will be fixed?

thanks


#5

this is supposed to be fixed in 2.1, which we are trying to ship today.


#6

2.1 shipped on Saturday. Have you tried it yet? This issue should be resolved.


#7

Hi Drew,

I have updated to 2.1 yesterday, but I have some issues with a different
script and I can’t start the application noe.

I will give a feedback on the session issue as soon as I get it to work.

Best regards

Gabriel


#8

Hi @drewpearce,

I tried upgrading to 2.1 (at least 3 times, clean install 2.0.4 and following upgrade steps http://wiki.dreamfactory.com/DreamFactory/Installation#Upgrade) but in Config tab I still see:

Admin Application Version: 2.1.1
DreamFactory Version: 2.0.4


#9

The same is happening to me. I repeated the update process a number of times but still see Admin App Version as 2.1.1 and DreamFactory Version as 2.0.4.

I’m getting some weird results from SSS, I think it has something to do with this.


#10

Hi @Elvis_Fernandes,

Check it out Error on service after upgrading to 2.1

I think the version info is just a string not updated… My DF is working and have bugs fixed, so its updated :slight_smile:


#11

Hi Drew,

This is fixed now, but the functionality is broken on a different point.
The event scripting post-process is not returning any custom data at all. I see that other reported already the bug (here), I hope this will be fixed soon. Otherwise I have to rollback to v2.0.1.

Thanks
Gabriel


#12

Hi @bitperbit,

If you are using the RETURN statement, it will not return custom data in v2.1.

Instead of this:

return {“test”:“ok”};

You should use this:

event.response.content = {“test”:“ok”};


#13

Thanks Anderson,

I did that soon after the update. The return is working for custom services (BTW, great improvement to be able to change the response code), but this is not working for scrips on post-process events. I think is a bug.

Thanks for the hint though,
Gabriel


#14

To verify version numbers, you can always check the readme and/or changelog files in the repositories.

@bitperbit what type of service are you trying to do a post process on, and what specifically is not working in the script?
(sorry, I’m a little confused after reading through this thread.)


#15

Hi Drew,

The session issue is OK.

I was referring to an issue regarding the post_process scripting when inserting a record in a mysql table.
I have open a bug-fix request here, with additional details.

Best regards
Gabriel


#16

Thanks. I’ll be looking into your bug report.