Details
-
Type: Bug
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Sprint:Winter 3 Jan 25 - Feb 5, Winter 4 Feb 8 - Feb 19, Winter 5 Feb 22 - Mar 5, Winter 6 Mar 8 - Mar 19
Description
Internal Server Error results when uploading this app:
Please investigate.
If there is a problem with the jar file or link, the interface should detect the problem and display a user-friendly message.
Attachments
Issue Links
- relates to
-
IGBF-2026 Improve submit app confirmation page to better inform user what is happening
- Closed
Activity
The code breaks when we submit the app again while the previous submission is still in pending state.
cc: [~aloraine]
error log: submit_app.models.AppPending.MultipleObjectsReturned: get() returned more than one AppPending – it returned 2!
This sounds like a problem with the code change that got rid of a "pending" variable error. Check the server and the "pending apps" folder, which is where a file is getting temporarily uploaded?
Also, take a look at the S3 buckets being used for each.
The code breaks when we have multiple version of the same app and we try to submit an old version again.
Steps to reproduce error:
1) Upload app-for-testing-app-workflow-2.0.0.jar by clicking "Next" and then click "Submit" (to put app into user-approved pending status)
2) Upload app-for-testing-app-workflow-1.0.0.jar. by clicking "Next" and then clicking "Submit"
3) Upload app-for-testing-app-workflow-1.0.0.jar again by clicking "Next" and observe a 500 Server error
The code breaks at submit_app/views.py at line number 124 in function "_app_summary" because `get_object_or_none` expects one object only but we will be getting two objects since we have two apps with same name Bundle_SymbolicName (but different Bundle_Version) in the table app_pending.
Testing steps:
1) Submit the app: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-1.0.0.jar
2) Submit the app once again and appstore should display app replacement message.
3) Submit a diff version of same app: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-2.0.0.jar(should display that an app has been submitted with diff version).
4) Submit the app with same version as step 1: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-1.0.0.jar.
Old Code: Appstore crashes.
New Code: Appstore should display step 2 msg.
cc: [~aloraine]
Please edit the above to provide more details about what "replacement message" consists of.
Also please clarify if the "diff version" should a higher or lower version of the App.
For testing instructions, do please use highly precise and specific language.
Lastly, when you say "submit" do you mean clicking the green button that says "submit" or do you mean something else?
Pease see comment on PR.
Testing steps:
1) Click on Submit app button on the homepage.
2) Enter the following link and then click on "Next" button.
link: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-1.0.0.jar
3) This should redirect to submit app confirmation page. The summary section will display the message "This is an all-new App. No released or pending App in App-Store has the same Bundle_SymbolicName. Congratulations on your App’s first release!".
4) Click on " Its all good. Submit my app ".
5) Repeat steps 1 to 3. This time the summary should change to "This is a replacement jar file for a not yet released App that you or a colleague already uploaded previously but is still in our “pending apps” waiting area. If you choose to submit it, this new jar file will replace the one that was uploaded before.". Click on " Its all good. Submit my app ".
6) Go to submit app page and submit a different version of the same app. It shouldn't matter if the app version is higher or lower the result should be the same in both the cases.
eg: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-2.0.0.jar
7) After clicking the "Next" button the app should redirect to the confirmation page. Please check the summary section. The message should be: "The jar file Bundle_SymbolicName matches a previously uploaded but not yet released App. The previously uploaded App’s Bundle_Version is different, however. Are you trying to release different versions of the same App. No problem!"
8) Click on "It's all good. Submit my app".
9) Repeat step 5. The current production code crashes here and redirects to 500 internal server page. The new code should display the same summary as step 5.
Test Case 2:
Delete the entry of "app-for-testing-app-workflow" app from the database. Make sure to delete all the entries of the app from the database.
1) Click on Submit app button on the homepage.
2) Enter the following link and then click on "Next" button.
link: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-1.0.0.jar
3) This should redirect to submit app confirmation page. The summary section will display the message "This is an all-new App. No released or pending App in App-Store has the same Bundle_SymbolicName. Congratulations on your App’s first release!".
4) Click on " Its all good. Submit my app ".
5) Click on Submit app button on the homepage.
6) Enter the following link and then click on "Next" button. This is the version 2.0.0 of the same app.
link: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-2.0.0.jar
7) This time the summary should change to "The jar file Bundle_SymbolicName matches a previously uploaded but not yet released App. The previously uploaded App’s Bundle_Version is different, however. Are you trying to release different versions of the same App. No problem!"
8) Click on " Its all good. Submit my app ".
9) Click on Submit app button on the homepage.
10) Enter the following link and then click on "Next" button. This is the version 3.0.0 of the same app.
link: https://bitbucket.org/lorainelab/app-for-testing-app-workflow/downloads/app-for-testing-app-workflow-3.0.0.jar
11) Production code: This redirects us to 500 Internal Server Error page
Branch code: Redirects us to confirmation page. The summary message should be "The jar file Bundle_SymbolicName matches a previously uploaded but not yet released App. The previously uploaded App’s Bundle_Version is different, however. Are you trying to release different versions of the same App. No problem!".
[~aloraine]: Please do not merge the PR after testing. I need to push some changes.
Thank you for the detailed explanation. I think I understand now....maybe.
Can you tell me if the following understanding is correct?
Our older (current) code is capable of handling a situation in which a user has uploaded and submitted an app and then, before the first upload has been released, the user uploads and submits another version of the same app. However, if the user tries to upload and submit a third version of the same app, we get an error. If so, then the order of submission of the apps doesn't really matter. What causes the internal server error is that there is more than one version of the app in pending state.
[~aloraine] Yes that is correct
Deployed on devappstore5.bioviz.org - please test thoroughly there.
Thanks Chirag Chandrahas Shetty for walking through the logic with me today!
Please look at the slide #5 from the Dropbox - https://www.dropbox.com/s/xe1v2jo17fg23th/SubmitApp-JarUpload.pptx?dl=0
It looks like case #5 was never implemented. If a user uploads (by clicking "Next") a jar file with the same Bundle_SymbolicName and different Bundle_Version as another app that has already been uploaded but is either "pending approved" or "pending not-yet-approved", then App Store is supposed to print the following in the summary:
Your uploaded jar file’s Bundle_SymbolicName matches a previously uploaded but not yet released App. The previously uploaded App’s Bundle_Version is different, however. Maybe you are trying to release different versions of the same App? No problem!
Case #5 was implemented thinking that only one app will be present in the "pending approved" or "pending not-yet-approved" state. The logic fails if two applications with same Bundle_SymbolicName and different Bundle_Version are present in the "pending approved" or "pending not-yet-approved" state and user tries to upload (by clicking "Next") a jar file with the same Bundle_SymbolicName.
cc: [~aloraine]
Merged and deployed to both devappstore3 and devappstore5 for testing.
Tested on devappstore5.bioviz.org, following the steps that resulted in the reported error. I am not seeing any errors at this time.
Deploying an entirely new instance of appstore to rule out a configuration issue.