Skip to content
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

Add exception handling to view account recovery poup #294

Open
nimish-ks opened this issue Jul 15, 2024 · 9 comments
Open

Add exception handling to view account recovery poup #294

nimish-ks opened this issue Jul 15, 2024 · 9 comments
Labels
bug Something isn't working fosshack Issues for FOSS Hack 2024 frontend Change in frontend code good first issue Good for newcomers

Comments

@nimish-ks
Copy link
Member

Describe the bug

Currently if a user wishes to view their recovery phrase by going to setting and happens enters an incorrect sudo password and clicks unlock the process fails silently without any obvious indication weather the password entered was correct or not.

To Reproduce

Steps to reproduce the behavior:

  1. Log into the Phase Console
  2. Go to Settings
  3. Click on the Account tab
  4. In the Recovery section click - View recovery info
    4.5 Open browser console
  5. In the View account recovery popup enter an incorrect password

Expected behavior

  1. There should be an indicator, ideally in the form of a spinner that is displayed on the Unlock button while the crypto functions are fired and keys are computed
  2. If a password that the user has entered is incorrect, a toast indicating a failure should be shown.

Screenshots

image

@nimish-ks nimish-ks added bug Something isn't working good first issue Good for newcomers frontend Change in frontend code fosshack Issues for FOSS Hack 2024 labels Jul 15, 2024
@krishchvn
Copy link

Hey @nimish-ks , can you assign the issue to me?

@krishchvn
Copy link

krishchvn commented Jul 18, 2024

Hey, I'm facing an error while trying to start docker containers.
image

I've added GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET.
Do I have to add # Integrations as well? If yes, where can I get them from?
"GITHUB_INTEGRATION_CLIENT_ID=
NEXT_PUBLIC_GITHUB_INTEGRATION_CLIENT_ID=
GITHUB_INTEGRATION_CLIENT_SECRET="

Can you help me out?

@rohan-chaturvedi
Copy link
Member

Hey @krishchvn , you don't need to add the integration variables. What is the error you are getting? I don't see any error logs on the screenshot you shared. Did you build the images first, with docker-compose -f dev-docker-compose.yml build ?

@krishchvn
Copy link

image
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:80 -> 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Yes, I've build docker images first,
image

@rohan-chaturvedi
Copy link
Member

Hmm, perhaps you are trying to access the console over http instead of https? With the default setup, the console will run at https://localhost with a self-signed cert.

@krishchvn
Copy link

I don't think so all containers are starting properly. Below is the log
✔ Container phase-redis-dev Created 0.0s
✔ Container phase-postgres Created 0.0s
✔ Container phase-backend-dev Recreated 1.5s
✔ Container phase-rqworker-dev Recreated 0.7s
✔ Container phase-frontend-dev Recreated 0.6s
✔ Container phase-nginx-dev Recreated 0.3s
Attaching to phase-backend-dev, phase-frontend-dev, phase-nginx-dev, phase-postgres, phase-redis-dev, phase-rqworker-dev
phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 * Redis version=7.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
phase-redis-dev | 1:M 18 Jul 2024 05:10:12.285 * monotonic clock: POSIX clock_gettime
phase-redis-dev | 1:M 18 Jul 2024 05:10:12.324 * Running mode=standalone, port=6379.
phase-postgres |
phase-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
phase-postgres |
phase-redis-dev | 1:M 18 Jul 2024 05:10:12.635 * Server initialized
phase-redis-dev | 1:M 18 Jul 2024 05:10:12.635 * Ready to accept connections tcp
phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: starting PostgreSQL 15.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: listening on IPv6 address "::", port 5432
phase-postgres | 2024-07-18 05:10:19.478 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
phase-postgres | 2024-07-18 05:10:19.790 UTC [24] LOG: database system was interrupted; last known up at 2024-07-18 04:11:38 UTC
phase-postgres | 2024-07-18 05:10:20.606 UTC [24] LOG: database system was not properly shut down; automatic recovery in progress
phase-postgres | 2024-07-18 05:10:20.613 UTC [24] LOG: invalid record length at 0/1B75A38: wanted 24, got 0
phase-postgres | 2024-07-18 05:10:20.613 UTC [24] LOG: redo is not required
phase-postgres | 2024-07-18 05:10:20.674 UTC [22] LOG: checkpoint starting: end-of-recovery immediate wait
phase-postgres | 2024-07-18 05:10:20.895 UTC [22] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.091 s, sync=0.021 s, total=0.276 s; sync files=2, longest=0.019 s, average=0.011 s; distance=0 kB, estimate=0 kB
phase-postgres | 2024-07-18 05:10:21.019 UTC [1] LOG: database system is ready to accept connections
Gracefully stopping... (press Ctrl+C again to force)
[+] Stopping 0/0

  • Container phase-nginx-dev Stopping 0.0s
  • Container phase-rqworker-dev Stopping 0.0s
    Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:80 -> 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

@rohan-chaturvedi
Copy link
Member

What do you see when you open https://localhost in the browser?

@nimish-ks
Copy link
Member Author

nimish-ks commented Jul 18, 2024

I don't think so all containers are starting properly. Below is the log ✔ Container phase-redis-dev Created 0.0s ✔ Container phase-postgres Created 0.0s ✔ Container phase-backend-dev Recreated 1.5s ✔ Container phase-rqworker-dev Recreated 0.7s ✔ Container phase-frontend-dev Recreated 0.6s ✔ Container phase-nginx-dev Recreated 0.3s Attaching to phase-backend-dev, phase-frontend-dev, phase-nginx-dev, phase-postgres, phase-redis-dev, phase-rqworker-dev phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 * Redis version=7.2.5, bits=64, commit=00000000, modified=0, pid=1, just started phase-redis-dev | 1:C 18 Jul 2024 05:10:12.284 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf phase-redis-dev | 1:M 18 Jul 2024 05:10:12.285 * monotonic clock: POSIX clock_gettime phase-redis-dev | 1:M 18 Jul 2024 05:10:12.324 * Running mode=standalone, port=6379. phase-postgres | phase-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization phase-postgres | phase-redis-dev | 1:M 18 Jul 2024 05:10:12.635 * Server initialized phase-redis-dev | 1:M 18 Jul 2024 05:10:12.635 * Ready to accept connections tcp phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: starting PostgreSQL 15.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 phase-postgres | 2024-07-18 05:10:19.397 UTC [1] LOG: listening on IPv6 address "::", port 5432 phase-postgres | 2024-07-18 05:10:19.478 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" phase-postgres | 2024-07-18 05:10:19.790 UTC [24] LOG: database system was interrupted; last known up at 2024-07-18 04:11:38 UTC phase-postgres | 2024-07-18 05:10:20.606 UTC [24] LOG: database system was not properly shut down; automatic recovery in progress phase-postgres | 2024-07-18 05:10:20.613 UTC [24] LOG: invalid record length at 0/1B75A38: wanted 24, got 0 phase-postgres | 2024-07-18 05:10:20.613 UTC [24] LOG: redo is not required phase-postgres | 2024-07-18 05:10:20.674 UTC [22] LOG: checkpoint starting: end-of-recovery immediate wait phase-postgres | 2024-07-18 05:10:20.895 UTC [22] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.091 s, sync=0.021 s, total=0.276 s; sync files=2, longest=0.019 s, average=0.011 s; distance=0 kB, estimate=0 kB phase-postgres | 2024-07-18 05:10:21.019 UTC [1] LOG: database system is ready to accept connections Gracefully stopping... (press Ctrl+C again to force) [+] Stopping 0/0

* Container phase-nginx-dev     Stopping                                                                                                                                                0.0s

* Container phase-rqworker-dev  Stopping                                                                                                                                                0.0s
  Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:80 -> 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

@krishchvn hey, this seems like your system (windows) is having trouble binding port 80 on your host system to 80 of the nginx container.

possible solutions:

  • permission issue - make sure the docker user has sudo access
  • check which port is currently using port 80 - netstat -ano | findstr :80, find the PID and kill the process by running taskkill /PID <PID> /F
  • bind 80 to a different port - eg. 8080 in your dev-docker-compose file

@krishchvn
Copy link

krishchvn commented Jul 18, 2024

Hi. Tried changing the port to 81:80 and it worked. Thanks guys.
However, I am getting a 504 Gateway Timed out error after logging into github on localhost.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fosshack Issues for FOSS Hack 2024 frontend Change in frontend code good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants