airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Christie (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AIRAVATA-2440) With keycloak, my username is changed, results a new data directory creation
Date Wed, 14 Jun 2017 21:05:00 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-2440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16049603#comment-16049603
] 

Marcus Christie edited comment on AIRAVATA-2440 at 6/14/17 9:04 PM:
--------------------------------------------------------------------

Query I used to update the DATA_REPLICA_LOCATION entries for seagrid on 149.165.156.11:

{code:sql}
set @user_data_dir = '/var/www/user_data/';
set @storage_id = '149.165.156.11_b5f26430-14d5-4372-8a7e-39b125aa640b';
update DATA_REPLICA_LOCATION
inner join (
    select 
        REPLICA_ID,
        FILE_PATH,
        SUBSTR(FILE_PATH, 
            LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir), 
            LOCATE('/', FILE_PATH, LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir))
            - (LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir))
        ) USERNAME
    from DATA_REPLICA_LOCATION where STORAGE_RESOURCE_ID = @storage_id
    and FILE_PATH like concat('%', @user_data_dir, '%')
) a
on a.REPLICA_ID = DATA_REPLICA_LOCATION.REPLICA_ID
set DATA_REPLICA_LOCATION.FILE_PATH = REPLACE(DATA_REPLICA_LOCATION.FILE_PATH, concat(@user_data_dir,
a.USERNAME), concat(@user_data_dir, LOWER(a.USERNAME)));

{code}

----
Updated the code to be more specific. I tested on a gateway that is the only gateway on that
particular pga instance. The {{@user_data_dir}} should be the path to a gateway's directory
(e.g., /var/www/portals/gateway-user-data/seagrid/) for PGA instances where there are multiple
hosted gateways.


was (Author: marcuschristie):
Query I used to update the DATA_REPLICA_LOCATION entries for seagrid on 149.165.156.11:

{code:sql}
set @user_data_dir = '/var/www/user_data/';
set @storage_id = '149.165.156.11_b5f26430-14d5-4372-8a7e-39b125aa640b';
update DATA_REPLICA_LOCATION
inner join (
    select 
        REPLICA_ID,
        FILE_PATH,
        SUBSTR(FILE_PATH, 
            LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir), 
            LOCATE('/', FILE_PATH, LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir))
            - (LOCATE(@user_data_dir, FILE_PATH) + LENGTH(@user_data_dir))
        ) USERNAME
    from DATA_REPLICA_LOCATION where STORAGE_RESOURCE_ID = @storage_id
) a
on a.REPLICA_ID = DATA_REPLICA_LOCATION.REPLICA_ID
set DATA_REPLICA_LOCATION.FILE_PATH = REPLACE(DATA_REPLICA_LOCATION.FILE_PATH, concat(@user_data_dir,
a.USERNAME), concat(@user_data_dir, LOWER(a.USERNAME)));
{code}


> With keycloak, my username is changed, results a new data directory creation
> ----------------------------------------------------------------------------
>
>                 Key: AIRAVATA-2440
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2440
>             Project: Airavata
>          Issue Type: Bug
>          Components: PGA PHP Web Gateway
>    Affects Versions: 0.17
>         Environment: http://149.165.156.11/
>            Reporter: Eroma
>            Assignee: Marcus Christie
>             Fix For: 0.17
>
>
> When login to PGA i gave ProdEroma2017 as the username. But once i am logged in to the
gateway, my username is displayed as proderoma2017. 
> In storage, now i have tow directories, ProdEroma2017 and proderoma2017. 
> When i clicked, 'Storage' from the main gateway menu, its empty.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message