Can't add Project to Program

#1

Hi,

I'm starting to try Gen3 Docker-compose on my Ubuntu@VirtualBox following the instruction at https://github.com/uc-cdis/compose-services.

By carefully following the steps therein, gen3 is setup and works. I'm able to login with my google account which is set with admin rights (users.yaml).

However, at the step "Using the Data Commons", I've created a program named "test_program" successfully (green text as indicated in the instruction). However, when i create a new project under "test_program" (https://localhost/test_program), it's failed with the message: "program test_program not found"

Do you have any clue for this?

Thank you very much

#2

Hi Cuong!

There could be an issue with creating program or with permissions. Please add a trackback from your terminal and a screenshot of a page, that would help to figure out what is going on. Is your program/project defined in a user.yaml file and do you have permissions to access it? Also could you query at https://localhost/query

{
 program (first:0){
   name
 }
}

and post a result here?

#3

Yes, it sounds like perhaps your program wasn't created or you don't have read access to it.
The query will check whether the program exists, but if you don't have 'read' access privileges in the user.yaml, then I don't think you'll see it. So, to help trouble-shoot, could you please share with us your user.yaml. Specifically, you'll want something like this:

resources:
- name: programs
  subresources:
  - name: test_program
    subresources:
    - name: projects
      subresources:
      - {name: test_project}
users:
  yourlogin@email.com:
    admin: true
    projects:
    - auth_id: test_program
      privilege: [create, read, update, delete, upload, read-storage, write-storage]
      resource: /programs/test_program
1 Like
#4

Dear,

Here is my user.yaml. It seems that i have to add project manually to a specific user, doesn't it?


cloud_providers: {}

groups: {}

users:
cdis:
juhuvn: True
juhuvn@gmail.com:
admin: True
projects:
- auth_id: jnkns
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]
- auth_id: jenkins
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]
projects:
- auth_id: DEV
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]
- auth_id: project1
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]
projects:
- auth_id: QA
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]
- auth_id: project1
privilege: ['create', 'read', 'update', 'delete', 'upload', read-storage]

#5

Hi Vik,
Visit ht+tps: //localhost/query and paste your code then click play, here is the result:
(due to restriction of 2 links in a post, all http will be replaced by ht+tp)

{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

And here is the log from console
sheepdog-service | {"gen3log": "nginx", "date_access": "2019-03-06T07:51:46+00:00", "user_id": "-", "request_id": "-", "session_id": "-", "visitor_id": "-", "network_client_ip": "-", "network_bytes_write": 141, "ht+tp_response_time": "0.001", "ht+tp_status_code": 404, "ht+tp_request": "/v0/flat-search/search/graphql", "ht+tp_verb": "POST", "ht+tp_referer": "ht+tps: //localhost/query", "http_useragent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0", "message": "POST /v0/flat-search/search/graphql HTTP/1.0"}
revproxy-service | 172.18.0.1 - - [06/Mar/2019:07:51:46 +0000] "POST /api/v0/flat-search/search/graphql HTTP/1.1" 404 141 "ht+tp://localhost/query" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0" "-"

#6

Hi Coung,

Let's try another way: please go to https://localhost and login with your google account. Then press "Query" button in the site navigation menu. On the Query page click on "switch to Graph Model" button, put your query to the 'GraphiQL' box and press "Execute Query" button. I added little animation.

What do you see as a result of this query?

#7

Yes, user.yaml file allows you to control user access for programs and projects. You can add something like that to you user.yaml:

projects:
- auth_id: test_program
privilege: ['create', 'read', 'update', 'delete', 'upload', 'read-storage']
- auth_id: test_project
privilege: ['create', 'read', 'update', 'delete', 'upload', 'read-storage']
#8

Here is the result of using Graph Model. Then, i was able to add project to test_program_name (ht tps://localhost/test_program_name).

{
"data": {
"program": [
{
"name": "Testing Program only"
},
{
"name": "Testing Program with GUID/UUID"
},
{
"name": "test_program_name"
}
]
}
}

Thank you very much.

#9

Hi! I'm glad it works now :slight_smile: