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: [External] Problem running mft portal

2020-04-09 Thread Bisht, Aarushi
Hi Sumant,


Thank you for pointing out the issue. I have fixed the error, can you please 
try again.

Also the current UI does not reflect the actual UX design. Please refer to 
https://issues.apache.org/jira/browse/AIRAVATA-3314 for the UX design that 
should be implemented.


Thanks?,

Aarushi Bisht


From: Sumant Gaopande 
Sent: Thursday, April 9, 2020 9:25 PM
To: dev@airavata.apache.org
Subject: [External] Problem running mft portal

This message was sent from a non-IU address. Please exercise caution when 
clicking links or opening attachments from external sources.

Hi,

I was trying to setup the mft portal as described in the following link:
 https://github.com/apache/airavata-mft-portal

While running
pip install -r requirements.txt

I get an installation error as seen in the attached screenshot - error.png.

I tried individually installing the requirements but I get an error with the 
versions mentioned for Django and djangorestframework. So I installed the 
latest versions for them and tried running the server manage.py but that threw 
an exception as described in the attached screenshot - server.png. Could you 
please help me with this?

Best,
Sumant


[GitHub] [airavata-mft-portal] aarushiibisht merged pull request #3: Corrected the startup error

2020-04-09 Thread GitBox
aarushiibisht merged pull request #3: Corrected the startup error
URL: https://github.com/apache/airavata-mft-portal/pull/3
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airavata-mft-portal] aarushiibisht opened a new pull request #3: Corrected the startup error

2020-04-09 Thread GitBox
aarushiibisht opened a new pull request #3: Corrected the startup error
URL: https://github.com/apache/airavata-mft-portal/pull/3
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airavata-mft-portal] smarru commented on issue #2: Initialized vue js app for storage units UI

2020-04-09 Thread GitBox
smarru commented on issue #2: Initialized vue js app for storage units UI
URL: https://github.com/apache/airavata-mft-portal/pull/2#issuecomment-611832741
 
 
   @aarushiibisht  I tried this PR and it throws the following error, can you 
please fix these:
   File "", line 1006, in _gcd_import
 File "", line 983, in _find_and_load
 File "", line 965, in _find_and_load_unlocked
   ModuleNotFoundError: No module named 'workspace'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
 File 
"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/threading.py",
 line 917, in _bootstrap_inner
   self.run()
 File 
"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/threading.py",
 line 865, in run
   self._target(*self._args, **self._kwargs)
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/utils/autoreload.py",
 line 53, in wrapper
   fn(*args, **kwargs)
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 line 109, in inner_run
   autoreload.raise_last_exception()
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/utils/autoreload.py",
 line 76, in raise_last_exception
   raise _exception[1]
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/core/management/__init__.py",
 line 357, in execute
   autoreload.check_errors(django.setup)()
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/utils/autoreload.py",
 line 53, in wrapper
   fn(*args, **kwargs)
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/__init__.py",
 line 24, in setup
   apps.populate(settings.INSTALLED_APPS)
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/apps/registry.py",
 line 91, in populate
   app_config = AppConfig.create(entry)
 File 
"/Users/smarru/code-repo/airavata-mft-portal/venv/lib/python3.7/site-packages/django/apps/config.py",
 line 160, in create
   app_name, mod_path, cls_name,
   django.core.exceptions.ImproperlyConfigured: Cannot import 'workspace'. 
Check that 'airavata_mft.apps.workspace.apps.WorkspaceConfig.name' is correct.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


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: 

[no subject]

2020-04-09 Thread Azmi, Asim Manzoor



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
>
>
>


[GitHub] [airavata-mft-portal] DImuthuUpe merged pull request #2: Initialized vue js app for storage units UI

2020-04-09 Thread GitBox
DImuthuUpe merged pull request #2: Initialized vue js app for storage units UI
URL: https://github.com/apache/airavata-mft-portal/pull/2
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


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: How to generate the structured js:es6 client stub for airavata api

2020-04-09 Thread Christie, Marcus Aaron


> On Apr 9, 2020, at 11:40 AM, Dinuka Desilva  wrote:
> 
> Oh. I got it. My question is how the token is passed for other endpoint like 
> this https://testdrive.airavata.org/api/applications/list_all/ 
> ?

Well, currently, it's not. The token is stored in the user's Django session. If 
the user is logged in, then that user can can call the API endpoints (Django 
assigns a cookie to identify the session).

We could add a token based authentication though. We would need a new custom 
authenticator [1] and we would need to extend the KeycloakBackend [2] to be 
able to authenticate a user based on an access token.

[1] 
https://www.django-rest-framework.org/api-guide/authentication/#custom-authentication
 

[2] 
https://github.com/apache/airavata-django-portal/blob/master/django_airavata/apps/auth/backends.py#L21
 


Then you would be able to call the Django REST API when the user's access token.

smime.p7s
Description: S/MIME cryptographic signature


[GitHub] [airavata-mft-portal] aarushiibisht opened a new pull request #2: Initialized vue js app for storage units UI

2020-04-09 Thread GitBox
aarushiibisht opened a new pull request #2: Initialized vue js app for storage 
units UI
URL: https://github.com/apache/airavata-mft-portal/pull/2
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Re: Login issue (Local dev. env. portal)

2020-04-09 Thread Bisht, Aarushi
Hi Nick,


Please make sure that the URLs in settings_local.py file are correctly 
configured. You can have a look at the settings_local.py.ide file.


- Aarushi Bisht


From: Mowery, Nicholas Benjamin 
Sent: Thursday, April 9, 2020 11:39 AM
To: dev@airavata.apache.org
Subject: [External] Login issue (Local dev. env. portal)

This message was sent from a non-IU address. Please exercise caution when 
clicking links or opening attachments from external sources.


Hi all,

I'm having an issue logging into my local portal. I've followed the 
instructions on confluence

(https://cwiki.apache.org/confluence/display/AIRAVATA/Setup+your+local+Airavata+Development+Environment)
 and the more detailed instructions on github

(https://github.com/apache/airavata/tree/master/modules/ide-integration) but 
receive the same error. I've used the gmail I created (with Less Security App 
access enabled):


email.based.monitor.address=airavatatest...@gmail.com


and the default-admin login, but both fail.



[cid:7cbda748-0de0-4728-ba61-68b0f3bb4ba4][cid:de07b287-b161-4474-9c48-11682b893168]


This is the log from the server after my failed login:

I have also set OAUTHLIB_INSECURE_TRANSPORT=1.


[cid:ba8a547d-0ce2-40e5-9127-4a79ad02091b]


Any help would be appreciated. Thanks.

-Nick


Re: How to generate the structured js:es6 client stub for airavata api

2020-04-09 Thread Dinuka Desilva
On Thu, Apr 9, 2020 at 9:03 PM Christie, Marcus Aaron 
wrote:

>
>
> On Apr 9, 2020, at 11:25 AM, Dinuka Desilva 
> wrote:
>
> I'm not sure how it could be used for django api requests. As in, whether
> to pass the "code" as a header etc. An example request call will be helpful.
>
>
> as a query parameter. See [1], in Django request.GET is a dictionary of
> query parameters. Notice that the response is a JSON response.
>

Oh. I got it. My question is how the token is passed for other endpoint
like this https://testdrive.airavata.org/api/applications/list_all/?



>
> [1]
> https://github.com/apache/airavata-django-portal/blob/develop/django_airavata/apps/auth/views.py#L458
>
>


Login issue (Local dev. env. portal)

2020-04-09 Thread Mowery, Nicholas Benjamin
Hi all,

I'm having an issue logging into my local portal. I've followed the 
instructions on confluence

(https://cwiki.apache.org/confluence/display/AIRAVATA/Setup+your+local+Airavata+Development+Environment)
 and the more detailed instructions on github

(https://github.com/apache/airavata/tree/master/modules/ide-integration) but 
receive the same error. I've used the gmail I created (with Less Security App 
access enabled):


email.based.monitor.address=airavatatest...@gmail.com


and the default-admin login, but both fail.



[cid:7cbda748-0de0-4728-ba61-68b0f3bb4ba4][cid:de07b287-b161-4474-9c48-11682b893168]


This is the log from the server after my failed login:

I have also set OAUTHLIB_INSECURE_TRANSPORT=1.


[cid:ba8a547d-0ce2-40e5-9127-4a79ad02091b]


Any help would be appreciated. Thanks.

-Nick


Re: How to generate the structured js:es6 client stub for airavata api

2020-04-09 Thread Christie, Marcus Aaron


> On Apr 9, 2020, at 11:25 AM, Dinuka Desilva  wrote:
> 
> I'm not sure how it could be used for django api requests. As in, whether to 
> pass the "code" as a header etc. An example request call will be helpful.

as a query parameter. See [1], in Django request.GET is a dictionary of query 
parameters. Notice that the response is a JSON response.

[1] 
https://github.com/apache/airavata-django-portal/blob/develop/django_airavata/apps/auth/views.py#L458
 




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 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: How to generate the structured js:es6 client stub for airavata api

2020-04-09 Thread Dinuka Desilva
Hi Marcus,

On Thu, Apr 9, 2020 at 3:35 AM Christie, Marcus Aaron 
wrote:

> Hi Dinuka,
>
> On Apr 8, 2020, at 3:50 PM, Dinuka Desilva 
> wrote:
>
> I tried this out. And some more questions
>
> 1) http://localhost:8000/auth/login-desktop from this upon successful
> login, it's redirected to
> https://testdrive.airavata.org/auth/login-desktop-success/? with status,
> code, refresh_code, valid_time and username as query parameters. But, a
> custom redirection url cannot be defined. (I couldn't find a way)
>
>
> The setting LOGIN_REDIRECT_URL sets the url to redirect to after logging
> in.
>
Yes. It works and an option given still it requires the desktop application
to have a dedicated server running since the redirect urls are different in
the web application.



> 2) Once above is executed, I ended up with the issue I have mentioned on
> another email thread [1]. I tried three times and it happened right after
> "login-desktop" request.
>
> 3) I tried this on https://testdrive.airavata.org/ also it has no issues.
> But, still I want to get the redirection happen to a custom url that I
> could specify. Could you help me figure out the right settings for that.
>
> 4) From the "login-desktop" requests, I get only the status, code,
> refresh_code, valid_time and username. Using these, how can I obtain the
> access token. Is there an api for that? I found only this
> "refreshed-token-desktop". But, still it returns no tokens in the response.
>
>
> The "code" is the access token.  You can supply refresh_code to
> refresh-token-desktop and the django portal will refresh it and give you an
> access token.
>

I'm not sure how it could be used for django api requests. As in, whether
to pass the "code" as a header etc. An example request call will be helpful.


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
>>
>>
>>