Skip to content

BB2-823: Attempt to fix docker issues#3

Merged
bfausett77 merged 17 commits intomainfrom
DockerIssues
Nov 15, 2021
Merged

BB2-823: Attempt to fix docker issues#3
bfausett77 merged 17 commits intomainfrom
DockerIssues

Conversation

@bfausett77
Copy link
Copy Markdown
Contributor

@bfausett77 bfausett77 commented Nov 2, 2021

This is more of a PR to review the entire 'Server' side of this application. To get this to run follow the README.

Let me know if you have questions, issues, suggestions.

@nbragdon
Copy link
Copy Markdown
Contributor

nbragdon commented Nov 4, 2021

@bfausett77 I think the readme could use a little work, here are a couple of things I would add:

  • One line saying something like "Setup Docker" which is just a link to docker documentation on getting it setup
  • After the docker compose, we should include where they should go to see the app running: http://localhost:3000/
  • We should include a link (probably before config) to tell them how to create a sandbox account + get the credentials

@bfausett77
Copy link
Copy Markdown
Contributor Author

@bfausett77 I think the readme could use a little work, here are a couple of things I would add:

  • One line saying something like "Setup Docker" which is just a link to docker documentation on getting it setup
  • After the docker compose, we should include where they should go to see the app running: http://localhost:3000/
  • We should include a link (probably before config) to tell them how to create a sandbox account + get the credentials

Excellent suggestions. I've updated the README accordingly.

Copy link
Copy Markdown
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bfausett77 I was able to get the client & server to startup OK. However, I'm not seeing any data in the app. From the docker-compose logging, it looks OK to me, but not seeing data returned.

Also, you can copy some of the python related configs from the BB2 .gitignore file so that "*.pyc" and other files don't get included in the repo.

LINK: https://github.com/CMSgov/bluebutton-web-server/blob/master/.gitignore

For example, I think everything could be included up to the "# Djano" comment and maybe some other items.

@nbragdon
Copy link
Copy Markdown
Contributor

nbragdon commented Nov 8, 2021

@dtisza1 I had the same thing happen on mine... @bfausett77 i'm wondering if you setup something locally that isn't checked in that we didn't setup on ours?

@bfausett77
Copy link
Copy Markdown
Contributor Author

@bfausett77 I was able to get the client & server to startup OK. However, I'm not seeing any data in the app. From the docker-compose logging, it looks OK to me, but not seeing data returned.

Also, you can copy some of the python related configs from the BB2 .gitignore file so that "*.pyc" and other files don't get included in the repo.

LINK: https://github.com/CMSgov/bluebutton-web-server/blob/master/.gitignore

For example, I think everything could be included up to the "# Djano" comment and maybe some other items.

I have updated the .gitignore file and removed the folders/files that shouldn't be there.

@bfausett77 bfausett77 closed this Nov 8, 2021
@bfausett77
Copy link
Copy Markdown
Contributor Author

@dtisza1 I had the same thing happen on mine... @bfausett77 i'm wondering if you setup something locally that isn't checked in that we didn't setup on ours?

Worked with you to find the issue in the views.py file - it was the if-else statement that was the issue

@bfausett77 bfausett77 reopened this Nov 8, 2021
@dtisza1
Copy link
Copy Markdown
Contributor

dtisza1 commented Nov 9, 2021

@bfausett77 Just tried it after your last updates. Still having an issue.

It looks related to the callback and exchanging the code for an access token with the /v2/o/token/ endpoint (gets a 400 response code per the Splunk logging.

My Sandbox app has this added to the redirect URI's list, which I believe is good: "http://localhost:3001/api/bluebutton/callback/"

Below are the docker-compose logs:

server_1  | HERE AUTHURLhttps://sandbox.bluebutton.cms.gov/v2/o/authorize?client_id=AdGJlRUrAl06ooDnMhNPccwcLYbLEu7ssRIRDrvE&redirect_uri=http://localhost:3001/api/bluebutton/callback/&state=fmpUJi5JUFd9NzdmU3AickU4RDc0VGQiWixrPFBIMGE=&response_type=code&code_challenge_method=S256&code_challenge=3PO7tAsg4NIs0F_jDJZuD3Kojs5sCuubq37DocIq-2A=
server_1  | 2021-11-09 15:52:49,811:werkzeug:INFO:172.30.0.3 - - [09/Nov/2021 15:52:49] "GET /api/authorize/authurl?pkce=true&version=v2&env=sandbox HTTP/1.1" 200 -
server_1  | HERE callback:
server_1  | code
server_1  | dD0iQ2mqrJLtNpUU56lbRzffqQZ53h
server_1  | state
server_1  | fmpUJi5JUFd9NzdmU3AickU4RDc0VGQiWixrPFBIMGE=
server_1  | configsettings
server_1  | {'bb2BaseUrl': 'https://sandbox.bluebutton.cms.gov', 'bb2ClientId': 'AdGJlRUrAl06ooDnMhNPccwcLYbLEu7ssRIRDrvE', 'bb2ClientSecret': 'ZZZZZZ-REMOVED--ZZZZ', 'bb2CallbackUrl': 'http://localhost:3001/api/bluebutton/callback/', 'port': 3001, 'host': 'server'}
server_1  | settings
server_1  | <src.entities.Settings.Settings object at 0x7f8c999fb880>
server_1  | authtoken:
server_1  | {'error': 'invalid_request', 'error_description': 'Mismatching redirect URI.'}
server_1  | logged User AuthTOken
server_1  | {'error': 'invalid_request', 'error_description': 'Mismatching redirect URI.'}
server_1  | AuthToken Access Token
server_1  | None
server_1  | BB2 BENEFIT URL
server_1  | https://sandbox.bluebutton.cms.gov/v2/fhir/ExplanationOfBenefit/
server_1  | ERROR:
server_1  | can only concatenate str (not "NoneType") to str
server_1  | 2021-11-09 15:52:59,712:werkzeug:INFO:172.30.0.1 - - [09/Nov/2021 15:52:59] "GET /api/bluebutton/callback/?code=dD0iQ2mqrJLtNpUU56lbRzffqQZ53h&state=fmpUJi5JUFd9NzdmU3AickU4RDc0VGQiWixrPFBIMGE%3D HTTP/1.1" 302 -
server_1  | 2021-11-09 15:52:59,873:werkzeug:INFO:172.30.0.3 - - [09/Nov/2021 15:52:59] "GET /api/data/benefit HTTP/1.1" 200 -

Comment thread server/src/app/views.py Outdated
@nbragdon
Copy link
Copy Markdown
Contributor

@bfausett77 Where did you get the logger factory class from? Also looks like it has some commented out lines

@nbragdon
Copy link
Copy Markdown
Contributor

@bfausett77 Looking around I noticed quite a few commented out items in different files - maybe take a clean up pass through?

@nbragdon
Copy link
Copy Markdown
Contributor

@bfausett77 All the changes helped! It's now working for me

@bfausett77
Copy link
Copy Markdown
Contributor Author

@dtisza1 I had the same thing happen on mine... @bfausett77 i'm wondering if you setup something locally that isn't checked in that we didn't setup on ours?

This should now be resolved as the changes I made yesterday

@bfausett77
Copy link
Copy Markdown
Contributor Author

@bfausett77 Looking around I noticed quite a few commented out items in different files - maybe take a clean up pass through?

I just completed this. Take a look and let e know if you have any other suggestions.

Comment thread .gitignore
Comment thread client/package.json
Comment thread server/src/app/views.py
Copy link
Copy Markdown
Contributor

@nbragdon nbragdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some non-required things to think about in the comments. Take a look and if you want to change them 👍 , otherwise it should be fine merging this in.

@bfausett77
Copy link
Copy Markdown
Contributor Author

@bfausett77 Where did you get the logger factory class from? Also looks like it has some commented out lines

These should all be cleaned up now.

Copy link
Copy Markdown
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bfausett77 I just tested and not having that callback URI placement issue anymore. It's working as expected.

This is looking good to me, except that .pyc files should be removed from this repo.

While looking through the files, I put this list and command line together that will remove them below:

git rm server/src/__pycache__/__init__.cpython-39.pyc server/src/app/__pycache__/__init__.cpython-39.pyc server/src/configs/__pycache__/__init__.cpython-39.pyc server/src/configs/__pycache__/config.cpython-39.pyc server/src/data/__pycache__/Database.cpython-39.pyc
 server/src/data/__pycache__/User.cpython-39.pyc server/src/data/__pycache__/__init__.cpython-39.pyc server/src/entities/__pycache__/AuthorizationToken.cpython-39.pyc server/src/entities/__pycache__/Settings.cpython-39.pyc server/src/entities/__pycache__/__init__.cpython-39.pyc server/src/prestart/__pycache__/__init__.cpython-39.pyc server/src/prestart/__pycache__/setenv.cpython-39.pyc server/src/shared/__pycache__/LoggerFactory.cpython-39.pyc server/src/shared/__pycache__/__init__.cpython-39.pyc server/src/utils/__pycache__/__init__.cpython-39.pyc server/src/utils/__pycache__/bb2Util.cpython-39.pyc server/src/utils/__pycache__/configUtil.cpython-39.pyc server/src/utils/__pycache__/generatePKCE.cpython-39.pyc server/src/utils/__pycache__/userUtil.cpython-39.pyc

# Then commit and push up changes.

Comment thread .gitignore Outdated
@bfausett77 bfausett77 changed the title Attempt to fix docker issues BB2-823: Attempt to fix docker issues Nov 15, 2021
Copy link
Copy Markdown
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bfausett77 This looks good to me! Great job on this!

@bfausett77 bfausett77 merged commit 66709c3 into main Nov 15, 2021
@bfausett77 bfausett77 deleted the DockerIssues branch November 15, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants