Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-10 Thread Isuru Ranawaka
Hi Dimuthu, Marcus

On Fri, Apr 10, 2020 at 9:47 AM Christie, Marcus Aaron 
wrote:

>
>
> On Apr 9, 2020, at 9:26 PM, DImuthu Upeksha 
> wrote:
>
> @Marcus, @Isuru
>
> I will regenerate them for now but in the long run we need to generate
> them automatically when the docker compose is executed. Probably via
> another container instance. However I'm not sure why it's even working at
> least for 30 minutes. It should be failed from the very first call to the
> Keycloak. For my setup, it doesn't even fail after 30 minutes.
>
>
Thanks. I am planning to develop some service to handle certificate
auto-renewal and updates in Custos. Maybe we can use that for Airavata as
well.







>
> Thanks Dimuthu. If it's easier we might put Keycloak behind an HTTPS proxy
> instead of configuring Keycloak to handle HTTPS.  Here are some rough notes
> I have from when I set this up with Apache handling HTTPS proxying to
> Keycloak:
>
>
> ## Proxy Keycloak behind Apache
>
> ```
> setsebool -P httpd_can_network_connect on
> ```
>
> https://serverfault.com/a/799090
>
> Turns out not strictly necessary, but I found this too:
>
> ```
> ...
> 
> ...
> RequestHeader set X-Forwarded-Proto "https"
> ...
> ```
>
> https://stackoverflow.com/a/57140468
>
>
> https://www.keycloak.org/docs/latest/server_installation/index.html#_setting-up-a-load-balancer-or-proxy
>
> Fixed by
>
> 1. Adding `proxy-address-forwarding="true"` and
> `redirect-socket="proxy-https"`
>in standalone.xml:
>
> ```xml
>  redirect-socket="proxy-https"
> proxy-address-forwarding="true"/>
> ```
>
> 2. Also changed to
>
> ```xml
> 
> ```
>
> 3. Added `ProxyPreserveHost On` to Apache VirtualHost
>
> ```ini
> RequestHeader set X-Forwarded-Proto "https"
> ProxyPass / "http://localhost:8080/;
> ProxyPassReverse / "http://localhost:8080/;
> ProxyPreserveHost On
> ```
>
>
>

-- 
Research Software Engineer
Indiana University, IN


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-10 Thread Christie, Marcus Aaron


> On Apr 9, 2020, at 9:26 PM, DImuthu Upeksha  
> wrote:
> 
> @Marcus, @Isuru
> 
> I will regenerate them for now but in the long run we need to generate them 
> automatically when the docker compose is executed. Probably via another 
> container instance. However I'm not sure why it's even working at least for 
> 30 minutes. It should be failed from the very first call to the Keycloak. For 
> my setup, it doesn't even fail after 30 minutes. 
> 

Thanks Dimuthu. If it's easier we might put Keycloak behind an HTTPS proxy 
instead of configuring Keycloak to handle HTTPS.  Here are some rough notes I 
have from when I set this up with Apache handling HTTPS proxying to Keycloak:


## Proxy Keycloak behind Apache

```
setsebool -P httpd_can_network_connect on
```

https://serverfault.com/a/799090

Turns out not strictly necessary, but I found this too:

```
...

...
RequestHeader set X-Forwarded-Proto "https"
...
```

https://stackoverflow.com/a/57140468

https://www.keycloak.org/docs/latest/server_installation/index.html#_setting-up-a-load-balancer-or-proxy

Fixed by

1. Adding `proxy-address-forwarding="true"` and `redirect-socket="proxy-https"`
   in standalone.xml:

```xml

```

2. Also changed to

```xml

```

3. Added `ProxyPreserveHost On` to Apache VirtualHost

```ini
RequestHeader set X-Forwarded-Proto "https"
ProxyPass / "http://localhost:8080/;
ProxyPassReverse / "http://localhost:8080/;
ProxyPreserveHost On
```



smime.p7s
Description: S/MIME cryptographic signature


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread DImuthu Upeksha
Dinuka,

I uploaded new certificates for ide integration module. You have do a full
cleanup of docker containers and restart APIServer to make it
fully functional.

docker-compose down
docker-compose rm
rm -rf database_data
docker-compose up

Here [2] are the commands to generate the self signed certificate in case
if we need it in future.

[2]
https://github.com/apache/airavata/tree/develop/modules/ide-integration#note-optional-creating-certificates-if-expired

Thanks
Dimuthu


On Thu, Apr 9, 2020 at 9:26 PM DImuthu Upeksha 
wrote:

> Dinuka
>
> I saw couple of issues but I believe that below is the closest issue
> from your logs
>
> 2020-04-09 00:00:39,326 [pool-79-thread-1] ERROR
> o.a.a.s.s.KeyCloakSecurityManager Error occurred while checking if user:
> default-admin is authorized for action: /airavata/getGatewayGroups in
> gateway: default []
> javax.net.ssl.SSLHandshakeException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
> at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
> at
> java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:645)
> at
> java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:464)
> at
> java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:360)
> at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
> at
> java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
> at
> java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:422)
> at
> java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181)
> at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)
> at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1460)
> at
> java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1368)
> at
> java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:437)
> at
> java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
> at
> java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:171)
> at
> java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
> at
> java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
> at
> java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
> at
> org.apache.airavata.service.security.KeyCloakSecurityManager.getFromUrl(KeyCloakSecurityManager.java:394)
> at
> org.apache.airavata.service.security.KeyCloakSecurityManager.getUserInfo(KeyCloakSecurityManager.java:318)
> at
> org.apache.airavata.service.security.KeyCloakSecurityManager.validateToken(KeyCloakSecurityManager.java:350)
> at
> org.apache.airavata.service.security.KeyCloakSecurityManager.getGatewayGroupMembership(KeyCloakSecurityManager.java:331)
> at
> org.apache.airavata.service.security.KeyCloakSecurityManager.isUserAuthorized(KeyCloakSecurityManager.java:253)
> at
> org.apache.airavata.service.security.interceptor.SecurityInterceptor.authorize(SecurityInterceptor.java:67)
> at
> org.apache.airavata.service.security.interceptor.SecurityInterceptor.invoke(SecurityInterceptor.java:52)
> at
> com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
> at
> com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
> at
> org.apache.airavata.api.server.handler.AiravataServerHandler$$EnhancerByGuice$$11b56453.getGatewayGroups()
> at
> org.apache.airavata.api.Airavata$Processor$getGatewayGroups.getResult(Airavata.java:23303)
> at
> org.apache.airavata.api.Airavata$Processor$getGatewayGroups.getResult(Airavata.java:23287)
> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> at
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:830)
>
> This happens because self signed ssl keys/certificates [1] for keycloak
> are valid till 02/2020. We need to update them.
>
> @Marcus, @Isuru
>
> I will regenerate them for now but in the long run we 

Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread DImuthu Upeksha
Dinuka

I saw couple of issues but I believe that below is the closest issue
from your logs

2020-04-09 00:00:39,326 [pool-79-thread-1] ERROR
o.a.a.s.s.KeyCloakSecurityManager Error occurred while checking if user:
default-admin is authorized for action: /airavata/getGatewayGroups in
gateway: default []
javax.net.ssl.SSLHandshakeException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
at
java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
at
java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
at
java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
at
java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:645)
at
java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:464)
at
java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:360)
at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
at
java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
at
java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:422)
at
java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1460)
at
java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1368)
at
java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:437)
at
java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
at
java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:171)
at
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
at
java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
at
java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at
org.apache.airavata.service.security.KeyCloakSecurityManager.getFromUrl(KeyCloakSecurityManager.java:394)
at
org.apache.airavata.service.security.KeyCloakSecurityManager.getUserInfo(KeyCloakSecurityManager.java:318)
at
org.apache.airavata.service.security.KeyCloakSecurityManager.validateToken(KeyCloakSecurityManager.java:350)
at
org.apache.airavata.service.security.KeyCloakSecurityManager.getGatewayGroupMembership(KeyCloakSecurityManager.java:331)
at
org.apache.airavata.service.security.KeyCloakSecurityManager.isUserAuthorized(KeyCloakSecurityManager.java:253)
at
org.apache.airavata.service.security.interceptor.SecurityInterceptor.authorize(SecurityInterceptor.java:67)
at
org.apache.airavata.service.security.interceptor.SecurityInterceptor.invoke(SecurityInterceptor.java:52)
at
com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
at
com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
at
org.apache.airavata.api.server.handler.AiravataServerHandler$$EnhancerByGuice$$11b56453.getGatewayGroups()
at
org.apache.airavata.api.Airavata$Processor$getGatewayGroups.getResult(Airavata.java:23303)
at
org.apache.airavata.api.Airavata$Processor$getGatewayGroups.getResult(Airavata.java:23287)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)

This happens because self signed ssl keys/certificates [1] for keycloak are
valid till 02/2020. We need to update them.

@Marcus, @Isuru

I will regenerate them for now but in the long run we need to generate them
automatically when the docker compose is executed. Probably via another
container instance. However I'm not sure why it's even working at least for
30 minutes. It should be failed from the very first call to the Keycloak.
For my setup, it doesn't even fail after 30 minutes.

Owner: CN=airavata.host, OU=airavata.host, O=airavata.host,
L=airavata.host, ST=airavata.host, C=airavata.host
Issuer: CN=airavata.host, OU=airavata.host, O=airavata.host,
L=airavata.host, ST=airavata.host, C=airavata.host
Serial number: 4a9e5bf1
*Valid from: Fri Feb 22 08:50:43 EST 2019 until: Mon Feb 17 08:50:43 EST
2020*
Certificate fingerprints:
 SHA1: 

Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread Dinuka Desilva
Hi Dimuthu,

Please find them below.

 settings_local.py


 Screenshot 2020-04-03 at 4.03.25 PM.png

Regards,
Dinuka

On Fri, Apr 10, 2020 at 5:00 AM DImuthu Upeksha 
wrote:

> Hi Dinuka,
>
> Can you please resend the screenshot you have sent before? I guess apache
> mail server drops attachments for some reason. Can you upload it to drive
> or dropbox and share the link?
>
> Thanks
> Dimuthu
>
> On Thu, Apr 9, 2020 at 11:27 AM Dinuka Desilva 
> wrote:
>
>> Hi Dimuthu,
>>
>> I'm using the "develop" branch on both repos. (airavata and
>> airavata-django-portal)
>>
>> Regards,
>> Dinuka
>>
>> On Thu, Apr 9, 2020 at 2:15 PM DImuthu Upeksha <
>> dimuthu.upeks...@gmail.com> wrote:
>>
>>> Dinuka,
>>>
>>> What is the branch you are using?
>>>
>>> Dimuthu
>>>
>>> On Wed, Apr 8, 2020 at 2:45 PM Dinuka Desilva 
>>> wrote:
>>>
 Hi,

 Let me upload the logs of docker-compose, airavata-server and
 airavata-django-portal below. I've been actually having this issue
 continuously and not once in a while. Most of the time after every 20-15
 minutes,I had to recreate everything. Sometimes even the first attempt end
 up with this issue.

 Regards,
 Dinuka

 On Wed, Apr 8, 2020 at 3:06 AM Christie, Marcus Aaron 
 wrote:

> I've seen this problem too. Are there an errors in the 'docker-compose
> up' output?
>
> On Apr 5, 2020, at 9:55 PM, Isuru Ranawaka  wrote:
>
> Hi all,
>
>
>
> On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  wrote:
>
>> Hi Isuru,
>>
>> I wonder if it is related to renew tokens? Any insights?
>>
>
> There is a chance. But,  AFAIK  the server caches authorization
> decisions for at least one hour through auth cache (by default this is
> enabled). So it is unlikely that the server may try to renew tokens before
> that time. Breaking in 30 minutes interval is wired.  Anyhow, there is a
> probability of occurring this if sever unable to access  sharing registry.
> Hence,   I think better to check whether  DB connections and IAM sever
> connections are correctly established.
>
> Is there any error logs on server-side ?
>
> thanks
> Isuru
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>>
>> Suresh
>>
>> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva 
>> wrote:
>>
>> Hi,
>>
>> I got the airava and airavata-django-portal running on localhost by
>> executing following script on 4 terminals one after the other.
>>
>>1. docker-compose down && rm -rf database_data/ && docker-compose
>>up
>>2. mvn exec:java
>>
>> -Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
>>3. . ./build_js.sh
>>4. source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf
>>db.sqlite3 && python manage.py migrate && python manage.py
>>load_default_gateway && python manage.py runserver
>>
>>
>> With this I could access the localhost server at
>> http://localhost:8000. But, only for less than half an hour it
>> worked and then it's ended up with the following error. It has the logged
>> in user though an error occurred.
>>
>> 
>>
>> Neither restarting the servers nor clearing cache didn't solve this
>> issue. And I had to execute above four script again which recreates the
>> database. For kind of each 20-30 minutes, I had to do this. I'm doubtful
>> whether I'm doing anything wrong.
>>
>> Also, below I have attached the settings_local.py.
>>
>> Thanka & Regards,
>> Dinuka
>> 
>>
>>
>>
>
> --
> Research Software Engineer
> Indiana University, IN
>
>
>


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread DImuthu Upeksha
Hi Dinuka,

Can you please resend the screenshot you have sent before? I guess apache
mail server drops attachments for some reason. Can you upload it to drive
or dropbox and share the link?

Thanks
Dimuthu

On Thu, Apr 9, 2020 at 11:27 AM Dinuka Desilva 
wrote:

> Hi Dimuthu,
>
> I'm using the "develop" branch on both repos. (airavata and
> airavata-django-portal)
>
> Regards,
> Dinuka
>
> On Thu, Apr 9, 2020 at 2:15 PM DImuthu Upeksha 
> wrote:
>
>> Dinuka,
>>
>> What is the branch you are using?
>>
>> Dimuthu
>>
>> On Wed, Apr 8, 2020 at 2:45 PM Dinuka Desilva 
>> wrote:
>>
>>> Hi,
>>>
>>> Let me upload the logs of docker-compose, airavata-server and
>>> airavata-django-portal below. I've been actually having this issue
>>> continuously and not once in a while. Most of the time after every 20-15
>>> minutes,I had to recreate everything. Sometimes even the first attempt end
>>> up with this issue.
>>>
>>> Regards,
>>> Dinuka
>>>
>>> On Wed, Apr 8, 2020 at 3:06 AM Christie, Marcus Aaron 
>>> wrote:
>>>
 I've seen this problem too. Are there an errors in the 'docker-compose
 up' output?

 On Apr 5, 2020, at 9:55 PM, Isuru Ranawaka  wrote:

 Hi all,



 On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  wrote:

> Hi Isuru,
>
> I wonder if it is related to renew tokens? Any insights?
>

 There is a chance. But,  AFAIK  the server caches authorization
 decisions for at least one hour through auth cache (by default this is
 enabled). So it is unlikely that the server may try to renew tokens before
 that time. Breaking in 30 minutes interval is wired.  Anyhow, there is a
 probability of occurring this if sever unable to access  sharing registry.
 Hence,   I think better to check whether  DB connections and IAM sever
 connections are correctly established.

 Is there any error logs on server-side ?

 thanks
 Isuru














>
> Suresh
>
> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva 
> wrote:
>
> Hi,
>
> I got the airava and airavata-django-portal running on localhost by
> executing following script on 4 terminals one after the other.
>
>1. docker-compose down && rm -rf database_data/ && docker-compose
>up
>2. mvn exec:java
>-Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
>3. . ./build_js.sh
>4. source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf
>db.sqlite3 && python manage.py migrate && python manage.py
>load_default_gateway && python manage.py runserver
>
>
> With this I could access the localhost server at http://localhost:8000.
> But, only for less than half an hour it worked and then it's ended up with
> the following error. It has the logged in user though an error occurred.
>
> 
>
> Neither restarting the servers nor clearing cache didn't solve this
> issue. And I had to execute above four script again which recreates the
> database. For kind of each 20-30 minutes, I had to do this. I'm doubtful
> whether I'm doing anything wrong.
>
> Also, below I have attached the settings_local.py.
>
> Thanka & Regards,
> Dinuka
> 
>
>
>

 --
 Research Software Engineer
 Indiana University, IN





Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread Dinuka Desilva
Hi Dimuthu,

I'm using the "develop" branch on both repos. (airavata and
airavata-django-portal)

Regards,
Dinuka

On Thu, Apr 9, 2020 at 2:15 PM DImuthu Upeksha 
wrote:

> Dinuka,
>
> What is the branch you are using?
>
> Dimuthu
>
> On Wed, Apr 8, 2020 at 2:45 PM Dinuka Desilva 
> wrote:
>
>> Hi,
>>
>> Let me upload the logs of docker-compose, airavata-server and
>> airavata-django-portal below. I've been actually having this issue
>> continuously and not once in a while. Most of the time after every 20-15
>> minutes,I had to recreate everything. Sometimes even the first attempt end
>> up with this issue.
>>
>> Regards,
>> Dinuka
>>
>> On Wed, Apr 8, 2020 at 3:06 AM Christie, Marcus Aaron 
>> wrote:
>>
>>> I've seen this problem too. Are there an errors in the 'docker-compose
>>> up' output?
>>>
>>> On Apr 5, 2020, at 9:55 PM, Isuru Ranawaka  wrote:
>>>
>>> Hi all,
>>>
>>>
>>>
>>> On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  wrote:
>>>
 Hi Isuru,

 I wonder if it is related to renew tokens? Any insights?

>>>
>>> There is a chance. But,  AFAIK  the server caches authorization
>>> decisions for at least one hour through auth cache (by default this is
>>> enabled). So it is unlikely that the server may try to renew tokens before
>>> that time. Breaking in 30 minutes interval is wired.  Anyhow, there is a
>>> probability of occurring this if sever unable to access  sharing registry.
>>> Hence,   I think better to check whether  DB connections and IAM sever
>>> connections are correctly established.
>>>
>>> Is there any error logs on server-side ?
>>>
>>> thanks
>>> Isuru
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

 Suresh

 On Apr 3, 2020, at 6:48 AM, Dinuka Desilva 
 wrote:

 Hi,

 I got the airava and airavata-django-portal running on localhost by
 executing following script on 4 terminals one after the other.

1. docker-compose down && rm -rf database_data/ && docker-compose up
2. mvn exec:java
-Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
3. . ./build_js.sh
4. source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf db.sqlite3
&& python manage.py migrate && python manage.py load_default_gateway &&
python manage.py runserver


 With this I could access the localhost server at http://localhost:8000.
 But, only for less than half an hour it worked and then it's ended up with
 the following error. It has the logged in user though an error occurred.

 

 Neither restarting the servers nor clearing cache didn't solve this
 issue. And I had to execute above four script again which recreates the
 database. For kind of each 20-30 minutes, I had to do this. I'm doubtful
 whether I'm doing anything wrong.

 Also, below I have attached the settings_local.py.

 Thanka & Regards,
 Dinuka
 



>>>
>>> --
>>> Research Software Engineer
>>> Indiana University, IN
>>>
>>>
>>>


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-09 Thread DImuthu Upeksha
Dinuka,

What is the branch you are using?

Dimuthu

On Wed, Apr 8, 2020 at 2:45 PM Dinuka Desilva 
wrote:

> Hi,
>
> Let me upload the logs of docker-compose, airavata-server and
> airavata-django-portal below. I've been actually having this issue
> continuously and not once in a while. Most of the time after every 20-15
> minutes,I had to recreate everything. Sometimes even the first attempt end
> up with this issue.
>
> Regards,
> Dinuka
>
> On Wed, Apr 8, 2020 at 3:06 AM Christie, Marcus Aaron 
> wrote:
>
>> I've seen this problem too. Are there an errors in the 'docker-compose
>> up' output?
>>
>> On Apr 5, 2020, at 9:55 PM, Isuru Ranawaka  wrote:
>>
>> Hi all,
>>
>>
>>
>> On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  wrote:
>>
>>> Hi Isuru,
>>>
>>> I wonder if it is related to renew tokens? Any insights?
>>>
>>
>> There is a chance. But,  AFAIK  the server caches authorization decisions
>> for at least one hour through auth cache (by default this is enabled). So
>> it is unlikely that the server may try to renew tokens before that time.
>> Breaking in 30 minutes interval is wired.  Anyhow, there is a probability
>> of occurring this if sever unable to access  sharing registry. Hence,   I
>> think better to check whether  DB connections and IAM sever connections are
>> correctly established.
>>
>> Is there any error logs on server-side ?
>>
>> thanks
>> Isuru
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>>
>>> Suresh
>>>
>>> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva 
>>> wrote:
>>>
>>> Hi,
>>>
>>> I got the airava and airavata-django-portal running on localhost by
>>> executing following script on 4 terminals one after the other.
>>>
>>>1. docker-compose down && rm -rf database_data/ && docker-compose up
>>>2. mvn exec:java
>>>-Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
>>>3. . ./build_js.sh
>>>4. source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf db.sqlite3
>>>&& python manage.py migrate && python manage.py load_default_gateway &&
>>>python manage.py runserver
>>>
>>>
>>> With this I could access the localhost server at http://localhost:8000.
>>> But, only for less than half an hour it worked and then it's ended up with
>>> the following error. It has the logged in user though an error occurred.
>>>
>>> 
>>>
>>> Neither restarting the servers nor clearing cache didn't solve this
>>> issue. And I had to execute above four script again which recreates the
>>> database. For kind of each 20-30 minutes, I had to do this. I'm doubtful
>>> whether I'm doing anything wrong.
>>>
>>> Also, below I have attached the settings_local.py.
>>>
>>> Thanka & Regards,
>>> Dinuka
>>> 
>>>
>>>
>>>
>>
>> --
>> Research Software Engineer
>> Indiana University, IN
>>
>>
>>


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-07 Thread Christie, Marcus Aaron
I've seen this problem too. Are there an errors in the 'docker-compose up' 
output?

> On Apr 5, 2020, at 9:55 PM, Isuru Ranawaka  wrote:
> 
> Hi all,
> 
> 
> 
> On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  > wrote:
> Hi Isuru,
> 
> I wonder if it is related to renew tokens? Any insights?
> 
> There is a chance. But,  AFAIK  the server caches authorization decisions for 
> at least one hour through auth cache (by default this is enabled). So it is 
> unlikely that the server may try to renew tokens before that time. Breaking 
> in 30 minutes interval is wired.  Anyhow, there is a probability of occurring 
> this if sever unable to access  sharing registry. Hence,   I think better to 
> check whether  DB connections and IAM sever connections are correctly 
> established. 
> 
> Is there any error logs on server-side ?
> 
> thanks
> Isuru
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> Suresh
> 
>> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva > > wrote:
>> 
>> Hi,
>> 
>> I got the airava and airavata-django-portal running on localhost by 
>> executing following script on 4 terminals one after the other. 
>> docker-compose down && rm -rf database_data/ && docker-compose up
>> mvn exec:java 
>> -Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
>> . ./build_js.sh
>> source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf db.sqlite3 && python 
>> manage.py migrate && python manage.py load_default_gateway && python 
>> manage.py runserver
>> 
>> With this I could access the localhost server at http://localhost:8000 
>> . But, only for less than half an hour it worked and 
>> then it's ended up with the following error. It has the logged in user 
>> though an error occurred. 
>> 
>> 
>> 
>> Neither restarting the servers nor clearing cache didn't solve this issue. 
>> And I had to execute above four script again which recreates the database. 
>> For kind of each 20-30 minutes, I had to do this. I'm doubtful whether I'm 
>> doing anything wrong. 
>> 
>> Also, below I have attached the settings_local.py.
>> 
>> Thanka & Regards,
>> Dinuka
>> 
> 
> 
> 
> -- 
> Research Software Engineer
> Indiana University, IN



smime.p7s
Description: S/MIME cryptographic signature


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-05 Thread Isuru Ranawaka
Hi all,



On Sun, Apr 5, 2020 at 8:59 PM Suresh Marru  wrote:

> Hi Isuru,
>
> I wonder if it is related to renew tokens? Any insights?
>

There is a chance. But,  AFAIK  the server caches authorization decisions
for at least one hour through auth cache (by default this is enabled). So
it is unlikely that the server may try to renew tokens before that time.
Breaking in 30 minutes interval is wired.  Anyhow, there is a probability
of occurring this if sever unable to access  sharing registry. Hence,   I
think better to check whether  DB connections and IAM sever connections are
correctly established.

Is there any error logs on server-side ?

thanks
Isuru














>
> Suresh
>
> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva 
> wrote:
>
> Hi,
>
> I got the airava and airavata-django-portal running on localhost by
> executing following script on 4 terminals one after the other.
>
>1. docker-compose down && rm -rf database_data/ && docker-compose up
>2. mvn exec:java
>-Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
>3. . ./build_js.sh
>4. source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf db.sqlite3 &&
>python manage.py migrate && python manage.py load_default_gateway && python
>manage.py runserver
>
>
> With this I could access the localhost server at http://localhost:8000.
> But, only for less than half an hour it worked and then it's ended up with
> the following error. It has the logged in user though an error occurred.
>
> 
>
> Neither restarting the servers nor clearing cache didn't solve this issue.
> And I had to execute above four script again which recreates the database.
> For kind of each 20-30 minutes, I had to do this. I'm doubtful whether I'm
> doing anything wrong.
>
> Also, below I have attached the settings_local.py.
>
> Thanka & Regards,
> Dinuka
> 
>
>
>

-- 
Research Software Engineer
Indiana University, IN


Re: [airavata-django-portal] Cannot keep the localhost db running for more than half a hour

2020-04-05 Thread Suresh Marru
Hi Isuru,

I wonder if it is related to renew tokens? Any insights?

Suresh

> On Apr 3, 2020, at 6:48 AM, Dinuka Desilva  wrote:
> 
> Hi,
> 
> I got the airava and airavata-django-portal running on localhost by executing 
> following script on 4 terminals one after the other. 
> docker-compose down && rm -rf database_data/ && docker-compose up
> mvn exec:java 
> -Dexec.mainClass="org.apache.airavata.ide.integration.APIServerStarter"
> . ./build_js.sh
> source ./venv/bin/activate && rm -rf ./tmp/ && rm -rf db.sqlite3 && python 
> manage.py migrate && python manage.py load_default_gateway && python 
> manage.py runserver
> 
> With this I could access the localhost server at http://localhost:8000 
> . But, only for less than half an hour it worked and 
> then it's ended up with the following error. It has the logged in user though 
> an error occurred. 
> 
> 
> 
> Neither restarting the servers nor clearing cache didn't solve this issue. 
> And I had to execute above four script again which recreates the database. 
> For kind of each 20-30 minutes, I had to do this. I'm doubtful whether I'm 
> doing anything wrong. 
> 
> Also, below I have attached the settings_local.py.
> 
> Thanka & Regards,
> Dinuka
>