Getting Error access token invalid after Implement High Availability

Hello All,

We are trying to implement  High Availability for our SugarCRM. We are getting error "The access token provided is invalid." when we try to execute REST API from our load balancer server. As per our initial finding, we observe that Oauth access token not sharing between two app server.

Please find the below details for reference.

Currently we are using SugarCRM 9.X professional version.

When we try to execute API from load balancer request will distribute both the server, we got success from one server and got error from second server. We are unable to find, from which server we are getting failure response. We need your technical team support to resolve the issue.

Please find our HA configuration:
Machines
1 Web Load Balancer
2 Web Servers
2 Database Servers (Active-Passive)
1 Elasticsearch Server

Thanks,
Nandkishore Bangar

Parents
  • You may want to use Memcache/Redis session management instead of files - so that it can be shared by both the servers. That might be causing your issue. 

  • Dear Neeraja,

    Thanks for your response.

    I am already using redis session, but still I am facing same issue.

    If you have any document related redis session with sugarcrm, please share with me. Might be I have missed some configuration.

    Thanks,

    Nandkishore Bangar

  • Should I address you as Nandkishore Bangar or Shiek Hussain? :)

    Did you get a chance to check the logs? Can you share it? 

    What kind of errors did you see?

    Was it an invalid_grant?

    Are your servers using the same unique_key? (from config.php).

    Are you accessing the servers from the same IP? Can you confirm if the load balancer correctly passes the client IP as part of HTTP_X_FORWARDED_FOR header?

    Another option is to enable debug logs in both the servers and try to collect logs - logs are the only debugging source that can help us here.

  • Dear Neeraja,

    You can call me Nandkishore.

    Please find inline comment.

    Did you get a chance to check the logs? Can you share it? 

    In the logs I am not getting any specific error.

    What kind of errors did you see?

    In the logs. I am getting error "The access token provided is invalid".

    Was it an invalid_grant?

    Yes

    Are your servers using the same unique_key? (from config.php).

    What is unique_key in config.php?

    Are you accessing the servers from the same IP? Can you confirm if the load balancer correctly passes the client IP as part of HTTP_X_FORWARDED_FOR header?

    Yes

    Another option is to enable debug logs in both the servers and try to collect logs - logs are the only debugging source that can help us here.

    Yes. I enabled it, but not getting any details error, because it is failing very first steps.

    Thanks,
    Nandkishore Bangar
Reply
  • Dear Neeraja,

    You can call me Nandkishore.

    Please find inline comment.

    Did you get a chance to check the logs? Can you share it? 

    In the logs I am not getting any specific error.

    What kind of errors did you see?

    In the logs. I am getting error "The access token provided is invalid".

    Was it an invalid_grant?

    Yes

    Are your servers using the same unique_key? (from config.php).

    What is unique_key in config.php?

    Are you accessing the servers from the same IP? Can you confirm if the load balancer correctly passes the client IP as part of HTTP_X_FORWARDED_FOR header?

    Yes

    Another option is to enable debug logs in both the servers and try to collect logs - logs are the only debugging source that can help us here.

    Yes. I enabled it, but not getting any details error, because it is failing very first steps.

    Thanks,
    Nandkishore Bangar
Children