Error: There is no valid session for the current request


#1

When I look at the logs, I see this error for every interaction I make with the remote database:-

“request_uri”:"/rest/sql/referral_view?filter=fromDoctorId%3D1",“source_ip”:“115...37”,“sapi_name”:“fpm-fcgi”} []
[2014-11-20 08:01:20] app.ERROR: REST Exception #401 > There is no valid session for the current request. {“host”:“ec2---137-23.ap-southeast-1.compute.amazonaws.com”,“request_uri”:"/rest/sql/referral",“source_ip”:“115...37”,“sapi_name”:“fpm-fcgi”} []

I have activated CORS Access of *, which means I am allowing it to be accessed from mobile apps.
I am not facing any issues as such from these errors, but I wonder why is this coming.

But yes, I notice that my Event Scripts ‘post process’ don’t get triggered, but ‘pre process’ do get triggered every-time. I guess what is happening is that pre_process script does get triggered, but the post_process scripts don’t get triggered ever because in between these two comes this above error in the background.
But, other than that I don’t face any other issues. My DB Transactions go through fine.


#2

I’m seeing the same error messages in my log files. It also looks like the swagger cache is being rebuilt every time a request is made. From my log file:

[2014-11-20 08:53:40][app][ERROR ] * System error deleting swagger cache file: portal.json
[2014-11-20 08:53:40][app][INFO ] Building Swagger cache
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 17 event(s).
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 82 event(s).
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 73 event(s).
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 30 event(s).
[2014-11-20 08:53:40][app][INFO ] * No Swagger content found for service “portal”
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 73 event(s).
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 73 event(s).
[2014-11-20 08:53:40][app][DEBUG ] * Discovered 30 event(s).
[2014-11-20 08:53:40][app][INFO ] Swagger cache build process complete


#3

The logging of a 401 error is normal for inauthenticated users. It’s part of the DSP first checking for an authenticated session, and then dropping you to the level of guest if none is found. It’s not an error per se unless you’re expecting to use an extant session.

Do you also have Allow Guest Users enabled?


#4

Yes. Guest Access is enabled.

Also, please see why is pre_process script triggered but post_process is not.