Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sifneos

    (@sifneos)

    Hello @arsalantariq,

    Sorry for the delay!

    Exactly this happens when I try to activate or deactivate the same licence at the same time from different instances. There are scenarios, where the C# code bellow is executed from several instances at the same time and sending activation or deactivation requests on the same license. I suppose, there is something wrong with DB lock? Otherwise, activate or deactivate works as it should.

            private void getLicense(String Path)        
            {            
                // Check Licence Key
                String json_str = "";
                System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                WebRequest req = WebRequest.Create(Path + p_licence_key);
                req.Timeout = 30*1000;            
                req.Method = "GET";
                req.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes("ck_5a36306960a962504f560d05062c79c8be3dcaa4:cs_0a9fd7286af43193a66321b359d0ce538fa8882c"));
                req.Credentials = new NetworkCredential("ck_5a36306960a962504f560d05062c79c8be3dcaa4", "cs_0a9fd7286af43193a66321b359d0ce538fa8882c");                          
    
                try{
                    HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
                    StreamReader reader = new StreamReader(resp.GetResponseStream());                      
                    string str = reader.ReadLine();                    
                    while(str != null)  
                    {                  
                        json_str = json_str + (str.Substring(0,str.Length));  
                        str = reader.ReadLine();                                                
                    }
                    
                    license = JsonConvert.DeserializeObject<License>(json_str);                
                    licenseExpirationDate = DateTime.Parse(license.Success_Data.ExpiresAt.DateTime.ToString());                
                }
                catch (Exception ex){
                    Print(ex);
                    Print("License key error: ", p_licence_key);
                    Stop();
                }                
            }
    Thread Starter sifneos

    (@sifneos)

    These are all error log message:

    [Sat Nov 06 08:12:35.116781 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: PHP Fatal error:  Uncaught Error: Call to a member function toArray() on bool in /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-content/plugins/license-manager-for-woocommerce/includes/api/v2/Licenses.php:792
    [Sat Nov 06 08:12:35.116845 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #1 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-includes/rest-api/class-wp-rest-server.php(987): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/lmfwc/v2/licen...', Array, NULL)
    [Sat Nov 06 08:12:35.116863 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #3 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-includes/rest-api.php(370): WP_REST_Server->serve_request('/lmfwc/v2/licen...')
    [Sat Nov 06 08:12:35.116872 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #4 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-includes/class-wp-hook.php(303): rest_api_loaded(Object(WP))
    [Sat Nov 06 08:12:35.116835 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #0 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-includes/rest-api/class-wp-rest-server.php(1140): LicenseManagerForWooCommerce\\API\\v2\\Licenses->deactivateLicense(Object(WP_REST_Request))
    [Sat Nov 06 08:12:35.116881 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #5 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-incl in /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-content/plugins/license-manager-for-woocommerce/includes/api/v2/Licenses.php on line 792
    [Sat Nov 06 08:12:35.116826 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: Stack trace:
    [Sat Nov 06 08:12:35.116854 2021] [-:error] [pid 90288:tid 34402912768] [client 2a00:d4a0:2:6b00:9ddd:907e:361:f050:60951] FastCGI: server "/var/run/hcgi/90232" stderr: #2 /home/ufesodoc/www/ufesodoc.myhostpoint.ch/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Server->dispatch(Object(WP_REST_Request))
Viewing 2 replies - 1 through 2 (of 2 total)