Question

Clio - execute-sql-script - Error

Hi Community! 

I'm expericing an error when using clio utility to run SQL in SQL Server or PostgreSQL cloud enviroments

Below the error:

System.Net.WebException: The remote server returned an error: (404) Not Found.

   at System.Net.HttpWebRequest.GetResponse()

   at Creatio.Client.ATFWebRequestExtension.GetServiceResponse(HttpWebRequest request)

   at Creatio.Client.CreatioClient.ExecutePostRequest(String url, String requestData, Int32 requestTimeout)

   at Clio.Common.CreatioClientAdapter.ExecutePostRequest(String url, String requestData, Int32 requestTimeout)

   at Clio.Common.SqlScriptExecutor.Execute(String sql, IApplicationClient applicationClient, EnvironmentSettings settings)

   at Clio.Command.SqlScriptCommand.SqlScriptCommand.Execute(ExecuteSqlScriptOptions opts)

 

Everything works as expected in local enviroments. I tried using the sql command directly or using sql file.

I found this article (https://community.creatio.com/questions/clio-error-when-running-sql-que…) with the same issue but the answer suggest to try the same in local enviroments. I did it and it works in local enviroments.

 

Regards.

Like 0

Like

1 comments
Best reply

Hi Uriel,

 

Before executing the SQL query in the cloud-based app you need to also install clio-gate that is not installed in the cloud apps by default. To do this execute the following command in clio:

 

clio.exe install-gate -e DemoTest

 

where DemoTest should be replaced with your registered environment name (more information can be found using

 

clio install-gate --h

 

command). Once the gate is installed you need to perform a restart using this command:

 

clio restart -e DemoTest

 

once again DemoTest should be replaced with your registered environment name. And finally, demo applications are deployed using PostgreSQL and you need to use the file with the command to properly execute it. So after that you need to execute:

 

clio execute-sql-script -f C:\Users\O.Drobina\Documents\clio\Contact.sql -e DemoTest

 

where C:\Users\O.Drobina\Documents\clio\Contact.sql should be replaced with the directory where the needed file with SQL query is located, DemoTest - use your registered environment name.

 

After that you will be able to get the result of the query.

 

Best regards,

Oscar 

Hi Uriel,

 

Before executing the SQL query in the cloud-based app you need to also install clio-gate that is not installed in the cloud apps by default. To do this execute the following command in clio:

 

clio.exe install-gate -e DemoTest

 

where DemoTest should be replaced with your registered environment name (more information can be found using

 

clio install-gate --h

 

command). Once the gate is installed you need to perform a restart using this command:

 

clio restart -e DemoTest

 

once again DemoTest should be replaced with your registered environment name. And finally, demo applications are deployed using PostgreSQL and you need to use the file with the command to properly execute it. So after that you need to execute:

 

clio execute-sql-script -f C:\Users\O.Drobina\Documents\clio\Contact.sql -e DemoTest

 

where C:\Users\O.Drobina\Documents\clio\Contact.sql should be replaced with the directory where the needed file with SQL query is located, DemoTest - use your registered environment name.

 

After that you will be able to get the result of the query.

 

Best regards,

Oscar 

Show all comments