Skip to content

Is1570/study fails 500 #1572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 22, 2020
Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 20, 2020

What do these changes do?

Sometimes client with old cookies would get 500 error when access studies (see #1570). I noticed that the cache in the authentication would lead to situations in which the request would authorized a user that actually does not exists anymore (e.g. because the garbage collector has removed it)

  • At the study access entrypoint:
    • Handles more safely "anonymous" users
    • Improves error handling
  • deleting a user also clear auth cache

Related issue number

Fixes #1570

How to test

cd services/web/server
make install-dev
pytest tests/unit/with_dbs/test_access_to_studies.py

NOTE: this fix should go ASAP to production (when approved, can be cherrypicked in staging , tested and then released)

Checklist

  • Did you change any service's API? Then make sure to bundle document and upgrade version (make openapi-specs, git commit ... and then make version-*)
  • Unit tests for the changes exist
  • Runs in the swarm
  • Documentation reflects the changes

@codecov
Copy link

codecov bot commented Jun 20, 2020

Codecov Report

Merging #1572 into master will increase coverage by 0.0%.
The diff coverage is 69.6%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1572   +/-   ##
======================================
  Coverage    72.4%   72.4%           
======================================
  Files         281     281           
  Lines       10737   10751   +14     
  Branches     1168    1168           
======================================
+ Hits         7783    7794   +11     
- Misses       2613    2617    +4     
+ Partials      341     340    -1     
Flag Coverage Δ
#integrationtests 57.4% <35.4%> (-0.1%) ⬇️
#unittests 65.0% <69.6%> (+<0.1%) ⬆️
Impacted Files Coverage Δ
...ce_webserver/resource_manager/garbage_collector.py 68.0% <0.0%> (ø)
.../web/server/src/simcore_service_webserver/utils.py 43.1% <33.3%> (-0.4%) ⬇️
packages/service-library/src/servicelib/utils.py 67.5% <50.0%> (ø)
...er/src/simcore_service_webserver/users_handlers.py 94.8% <50.0%> (ø)
...er/src/simcore_service_webserver/studies_access.py 87.8% <64.2%> (-0.5%) ⬇️
...rver/src/simcore_service_webserver/security_api.py 75.8% <100.0%> (+3.8%) ⬆️
.../server/src/simcore_service_webserver/users_api.py 94.3% <100.0%> (+0.1%) ⬆️

@pcrespov pcrespov marked this pull request as ready for review June 20, 2020 20:38
@pcrespov pcrespov self-assigned this Jun 20, 2020
@pcrespov pcrespov requested review from odeimaiz, sanderegg and GitHK June 20, 2020 20:38
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

I like the general improvements. Also like that you simulated the issue with a test case! We should do more of those.
Added some trivial suggestions.

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

some minor comments. great stuff.

@pcrespov pcrespov mentioned this pull request Jun 22, 2020
3 tasks
@pcrespov pcrespov merged commit 1b7a47e into ITISFoundation:master Jun 22, 2020
@pcrespov pcrespov deleted the is1570/study-fails-500 branch June 22, 2020 11:37
@pcrespov pcrespov mentioned this pull request Jun 22, 2020
5 tasks
@odeimaiz odeimaiz added this to the Huo Guo milestone Jul 2, 2020
@odeimaiz odeimaiz mentioned this pull request Aug 4, 2020
odeimaiz added a commit that referenced this pull request Aug 4, 2020
- UI/UX improvements (#1657)
- Bump yarl from 1.4.2 to 1.5.1 in /packages/postgres-database (#1665)
- Bump ujson from 3.0.0 to 3.1.0 in /packages/service-library (#1664)
- Bump pytest-docker from 0.7.2 to 0.8.0 in /packages/service-library (#1647)
- Improving storage performance (#1659)
- Bump aiozipkin from 0.6.0 to 0.7.0 in /packages/service-library (#1642)
- Theming (#1656)
- Platform stability:  (#1645)
- is1594 fix and re-activate e2e testing (#1620)
- 2 bugs fixed + Some improvements (#1634)
- Fixes default (#1640)
- Bump lodash from 4.17.15 to 4.17.19 (#1639)
- Is1585/cleanup storage (#1586)
- Fixes on publish studies handling (#1632)
- Some enhancements and bug fixes (#1608)
- Improve e2e  (#1631)
- filter studies by name before deleting them (#1629)
- Maintenance/upgrades test tools (#1628)
- Bugfix/concurent opening projects (#1598)
- Bugfix/allow reading groups anonymous user (#1615)
- Bump docker from 4.2.1 to 4.2.2 in /packages/postgres-database (#1605)
- fix testing if node has gpu support (#1604)
- [bugfix] Invalidate cache before starting a study (#1602)
- Feature/fix e2e 2 (#1600)
- fix deploy not needing e2e testing since it is disabled
- reduce cardinality of metrics (#1593)
- Excudes e2e stage from include until fixed (#1595)
- Shared project concurrency (frontend) (#1591)
- Homogenize studies and services (#1569)
- [feature] UI Fine grained access - project locking and notification
- Bugfix/apiserver does not need sslheaders (#1564)
- Cleanup catalog service (#1582)
- Maintenance/cleanup api server (#1578)
- Adds support for GPU scheduling of computational services (#1553)
- Maintenance/upgrades and tooling (#1546)
- Is1570/study fails 500 (#1572)
- Bump faker from 4.1.0 to 4.1.1 in /packages/postgres-database (#1573)
- maintenance fix codecov reports (#1568)
- Manage groups, Share studies (#1512)
- Is/add notebook migration script (#1565)
- Is1269/api-server upgrade (#1475)
- added simcore_webserver_service in pytest simcore package (#1563)
- add traefik endpoint to api-gateway (#1555)
@sanderegg sanderegg mentioned this pull request Aug 21, 2020
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.

Access to study with anonymous user returns 500
4 participants