Mentorship-android: Internal Server Error Response

Created on 29 Feb 2020  路  34Comments  路  Source: anitab-org/mentorship-android

Describe the bug
When I'm trying to login or even signup, I got Internal Server Error Message in the debugging box.
I've attached a screenshot of the debugging box.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Login Screen'
  2. Click on 'Login'
  3. See error

Expected behavior
Normal Login or signup

Screenshots
Screenshot_1582975311

image

Smartphone:

  • Device: [PIXEL]
  • OS: [Android]
  • API Version [29]
Question

Most helpful comment

I have another short mail. But I'm using this for just signup while testing 馃槃.

Lucky you did, otherwise the bug would sneaked in without us realising it... 馃ぃ

All 34 comments

Hi @Abdelaty,

I had the same issue before. At the moment, perhaps connection to the http://systers-mentorship-dev.eu-central-1.elasticbeanstalk.com is down. But I just found out how to test our app locally.

If you already forked the mentorship-backend, you just need to set the FLASK_ENVIRONMENT_CONFIG to 'local' (make sure you pull the latest code from repo). Then run the backend server.

On the Android side, change the Build Variants to develop_localhost as @annabauza mentioned in Zulip.

Then you can run the app and signup to create user.

Hope this helps.

The next problem for us is the confirmation email didn't get recognised because it has problem connecting to localhost.

  • error message when confirmation link was clicked from confirmation email:

Screen Shot 2020-03-01 at 3 28 45 pm

  • error message when I try to login:

Screen Shot 2020-03-01 at 3 28 36 pm

Will let you know if I find anything.

Hey! @mtreacy002 as you are testing the app locally, you need to sign in with your email id on your local machine and then open the link. I hope it will help!

Hey! @mtreacy002 as you are testing the app locally, you need to sign in with your email id on your local machine and then open the link. I hope it will help!

Hi @vatsalkul, can you please be specific in which space I need to sign in with my email id and which link I need to open? Thanks.

Note: I just tried to sign in in emulator with email id as you said still get the same response that I need to confirm my email.

@mtreacy002 After running the server on local machine i.e. your laptop, open the confirmation link which was sent during signup of mentorship app on your laptop.
As the server is hosted locally the url you are receiving on your email needed to be open by machine where the server is hosted! If you are still facing some issue... HMU on zulip

Hi again @vatsalkul. I have tried to open this link on the laptop, I even open my email inside Safari browser and still have the same error message as above.

Screen Shot 2020-03-01 at 4 06 01 pm

Screen Shot 2020-03-01 at 4 06 12 pm

@mtreacy002 After running the server on local machine i.e. your laptop, open the confirmation link which was sent during signup of mentorship app on your laptop.
As the server is hosted locally the url you are receiving on your email needed to be open by machine where the server is hosted! If you are still facing some issue... HMU on zulip

Hi again, I solved the email confirmation by changing the IP 127.0.0.1 instead of 10.0.2.2. So, you'd receive link like this:

http://10.0.2.2:5000/user/confirm_email/Im10cmVhY3kwMDJAZ21haWwuY29tIg.ETzGPA.XD4bqgCfHQ1Z-sKlcUiXQYbbbXw

Now, change it to this

http://127.0.0.1:5000/user/confirm_email/Im10cmVhY3kwMDJAZ21haWwuY29tIg.ETzGPA.XD4bqgCfHQ1Z-sKlcUiXQYbbbXw

then you'll see this

Screen Shot 2020-03-01 at 5 04 51 pm

Hint: the IP address of your localhost might be different than mine. So make sure you use the one that is used by the backend-server when running the app:

Screen Shot 2020-03-01 at 5 23 48 pm

馃帀

@Abdelaty, @vatsalkul has kindly created a word doc on how to set up back-end & front-end here. Thanks, @vatsalkul for the info. 馃憤

Thank you @mtreacy002 for your response, And thank you @vatsalkul very much for this doc. It will make the set-up easy for all the newcomers.

Just wanna mentioned that this issue might be related to #590 of Android and #466 of Backend. There is also another PR #605 of Android for Documentation on running server locally. We probably have to wait for an admin/ a mentor to confirm which one will be adopted. I haven't try #605, but maybe this is one of the case where 'there is more than one road to Rome'? 馃槈

@mtreacy002
I am facing the same issue.
Could you please guide me through it?

@Priyansh-Kedia, you should look at this google doc posted by @vatsalkul on Zulip. It is pretty detail and helpful. Let me know if you still facing issue. I'll be back again tomorrow around 8am AEST (Australian Eastern Standard Time). 馃槈

Is this issue resolved?
I am not able to Signup because of that, I can't explore inside the app.

@Priyansh-Kedia and @Sunil16202, Can you please specify where you come across the issue when you are following the document above? Screenshots would be helpful.

@mtreacy002 I followed the link provided by you but could not resolve my issue.
The virtual environment shows error when tried to activate.
The error shows that bin folder does not exist.

@Priyansh-Kedia, I think it might be related to the virtual environment you are using. For me, I'm using the virtualenvwrapper. For this type of venv I need to set all information in the .bash_profile (such as the project home directory and location for the venv scripting file, the location of venvs folder, etc). In my case, if these don't get set up properly, I will get errors. More info can be found here. Do you have screenshots?

@Priyansh-Kedia, there is also another discussion on Zulip about other PR that provide alternative way to run server locally

@Abdelaty can you test this again (or @mtreacy002 @vatsalkul @Priyansh-Kedia )
I think this may no longer be happening.
Current APK: https://github.com/systers/mentorship-android/raw/apk/app-debug.apk

@Abdelaty can you test this again (or @mtreacy002 @vatsalkul @Priyansh-Kedia )
I think this may no longer be happening.
Current APK: https://github.com/systers/mentorship-android/raw/apk/app-debug.apk

Hi @isabelcosta, I have tried this and can confirm that I have no issue signing up. Thanks for fixing this. 馃
Screen Shot 2020-03-17 at 9 28 50 am

I think if anyone else could also confirm this (@Abdelaty or @vatsalkul or @Priyansh-Kedia) that'll be great.

Thank you so so much @mtreacy002 馃檹
I will close this issue then, since I also tested this :D

Thank you so so much @mtreacy002 馃檹
I will close this issue then, since I also tested this :D

Cool : 馃槑 馃憤

It's still happening when I'm trying to sign-up
WhatsApp Image 2020-03-17 at 01 21 31

@Abdelaty have you downloaded and installed the most recent version of the app? I will check the logs though

@isabelcosta Yes, this is the new APK, I'm away from my PC so I can't build a one and post logs.
Sorry for that!

Oh my 馃槺 I see the issue now, this is another one though:

2020-03-16T23:11:06.011974+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
2020-03-16T23:11:06.011975+00:00 app[web.1]:     cursor.execute(statement, parameters)
2020-03-16T23:11:06.011975+00:00 app[web.1]: sqlalchemy.exc.DataError: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(30)
2020-03-16T23:11:06.011976+00:00 app[web.1]:  [SQL: 'INSERT INTO users (name, username, email, password_hash, registration_date, terms_and_conditions_checked, is_admin, is_email_verified, email_verification_date, current_mentorship_role, membership_status, bio, location, occupation, organization, slack_username, social_media_links, skills, interests, resume_url, photo_url, need_mentoring, available_to_mentor) VALUES (%(name)s, %(username)s, %(email)s, %(password_hash)s, %(registration_date)s, %(terms_and_conditions_checked)s, %(is_admin)s, %(is_email_verified)s, %(email_verification_date)s, %(current_mentorship_role)s, %(membership_status)s, %(bio)s, %(location)s, %(occupation)s, %(organization)s, %(slack_username)s, %(social_media_links)s, %(skills)s, %(interests)s, %(resume_url)s, %(photo_url)s, %(need_mentoring)s, %(available_to_mentor)s) RETURNING users.id'] [parameters: {'name': 'abdelaty', 'username': 'abdelaty', 'email': '[email protected]', 'password_hash': 'pbkdf2:sha256:50000$yuM6HNm2$e5d7af31bd78148721c66bff1225e8b50510a7693417292834f3158069d67054', 'registration_date': 1584400265.864559, 'terms_and_conditions_checked': True, 'is_admin': False, 'is_email_verified': False, 'email_verification_date': None, 'current_mentorship_role': None, 'membership_status': None, 'bio': None, 'location': None, 'occupation': None, 'organization': None, 'slack_username': None, 'social_media_links': None, 'skills': None, 'interests': None, 'resume_url': None, 'photo_url': None, 'need_mentoring': True, 'available_to_mentor': True}] (Background on this error at: http://sqlalche.me/e/9h9h)
2020-03-16T23:11:06.012795+00:00 app[web.1]: 10.8.2.166 - - [16/Mar/2020:23:11:06 +0000] "POST /register HTTP/1.1" 500 43 "-" "okhttp/3.10.0"

image

what a silly mistake 馃う鈥嶁檧 So your email is > 30 characters long, which in the backend code it is supposed to be shorter
馃憠 https://github.com/anitab-org/mentorship-backend/blob/develop/app/database/models/user.py#L26

@Abdelaty thank you for testing even when we closed the issue and therefore shining a light on this issue! Do you want to create a bug report on the Backend repository? I can do it, I am just asking because you were the one that brought this up :D

馃槃 Sorry for that, Yes sure I think there's too many emails with more than 30 letter. as an example my email or any organization name like:
@theportalagency.com it's more than 18 letter without adding a name or a user id.

Very good observation @Abdelaty ! No need to be sorry, that was a great test to do that highlighted a "bug" in the app (bug or poor design decision on the email limit size).
So thank you 馃檹 and congrats on finding a bug ;)

Wahhh.... Good catch @Abdelaty. I'm glad you bring it up. mine must have been pretty short as I use nickname only.. 馃槉

I have another short mail. But I'm using this for just signup while testing 馃槃.

I have another short mail. But I'm using this for just signup while testing 馃槃.

Lucky you did, otherwise the bug would sneaked in without us realising it... 馃ぃ

Lucky you did, otherwise the bug would sneaked in without us realising it... 馃ぃ

Very true @mtreacy002

I would love if you could report the issue @Abdelaty . Feel free to include the images and logs I provided in the comments ;) Let me know if you need any help with it

just for cross reference, here it is the issue created by @Abdelaty 馃帀 https://github.com/anitab-org/mentorship-backend/issues/504

Was this page helpful?
0 / 5 - 0 ratings

Related issues

annabauza picture annabauza  路  6Comments

yatri1609 picture yatri1609  路  5Comments

devanshi7799 picture devanshi7799  路  8Comments

isabelcosta picture isabelcosta  路  4Comments

mohak1283 picture mohak1283  路  9Comments