bslatkin / dpxdt

Make continuous deployment safe by comparing before and after webpage screenshots for each release. Depicted shows when any visual, perceptual differences are found. This is the ultimate, automated end-to-end test.
https://dpxdt-test.appspot.com
Apache License 2.0
1.44k stars 124 forks source link

Deployment Login #208

Closed cmrockwell closed 7 years ago

cmrockwell commented 7 years ago

I'm trying to setup a deployment server following this section. https://github.com/bslatkin/dpxdt/blob/master/README.md#deployment

Everything seems to launch ok. But I cannot get the sign on to work. I've checked and double-checked the settings.cfg and Google Console. When I click sign in or Create new build, it redirects to Google. If I accept, it take me back to the initial dpxpt server interface without signing in or creating the build. I'm not sure what I'm missing.

The test instance is here if it helps.

http://ec2-52-90-21-215.compute-1.amazonaws.com:5000/

weeksghost commented 7 years ago

Hello,

Not sure what might be going on there but I would look at two things closely:

1) Your dpxdt server log output at the time you are making your login attempts.

2) The flags you are using for your runserver.

Perhaps there are some clues in one of those places?

cmrockwell commented 7 years ago

Thanks for the suggestions. Regarding the first point checking the logs, nothing stands out to me. I pasted it below. does this look normal?

$ sudo ./run.sh > dpxdt.log & $ sudo -H ./run.sh > dpxdt.log & [1] 4840 INFO run_server.py:70] Workers started INFO _internal.py:87] * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) INFO fetch_worker.py:149] "/api/work_queue/capture/lease" 200 via internal routing INFO fetch_worker.py:149] "/api/work_queue/run-pdiff/lease" 200 via internal routing INFO _internal.py:87] 141.211.155.199 - - [10/Nov/2016 20:21:49] "GET / HTTP/1.1" 200 - INFO _internal.py:87] 141.211.155.199 - - [10/Nov/2016 20:21:51] "GET /new HTTP/1.1" 302 - INFO _internal.py:87] 141.211.155.199 - - [10/Nov/2016 20:21:52] "GET /login?next=%2Fnew HTTP/1.1" 302 - INFO _internal.py:87] 141.211.155.199 - - [10/Nov/2016 20:21:55] "GET /?state=/new&code=4/F56t0xwxKrEKLdpEz2l6oXMP5RLAVA9lqO9poM2aQek HTTP/1.1" 200 - INFO fetch_worker.py:149] "/api/work_queue/capture/lease" 200 via internal routing INFO fetch_worker.py:149] "/api/work_queue/run-pdiff/lease" 200 via internal routing INFO _internal.py:87] 141.211.155.199 - - [10/Nov/2016 20:22:03] "GET /?state=/new&code=4/F56t0xwxKrEKLdpEz2l6oXMP5RLAVA9lqO9poM2aQek HTTP/1.1" 200 -

The flags.cfg from the deployment/sqlite directory is below. I hide the client id and secret...

$ cat flags.cfg --port=5000 --enable_api_server --enable_queue_workers --fetch_use_internal_redirects --release_server_prefix=http://localhost:5000/api --queue_server_prefix=http://localhost:5000/api/work_queue --fetch_frequency=10 --fetch_threads=10 --capture_threads=10 --capture_wait_seconds=2 --phantomjs_timeout=20 --queue_idle_poll_seconds=30 --queue_busy_poll_seconds=1 --pdiff_threads=10 --pdiff_wait_seconds=2 --pdiff_timeout=20 --polltime=1 --release_client_id=xxxxxxxx --release_client_secret=yyyyyyy

weeksghost commented 7 years ago

Okay, anything I comment on is speculative at this point. I plugged the same flags you are using into my run_server and here was my output, specifically the output when I log in:

INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:25] "GET /login?next=%2F HTTP/1.1" 302 - INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:25] "GET /oauth2callback?state=/&code=4/1fDADaz3A-iyxRCl7OHNsGtIrsj2gB_V8JDC9oqoCtc HTTP/1.1" 302 -

Full output...

INFO _internal.py:87] * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) INFO fetch_worker.py:149] "/api/work_queue/run-pdiff/lease" 200 via internal routing INFO fetch_worker.py:149] "/api/work_queue/capture/lease" 200 via internal routing INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:19] "GET / HTTP/1.1" 200 - INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:19] "GET /static/img/favicon.ico HTTP/1.1" 200 - INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:25] "GET /login?next=%2F HTTP/1.1" 302 - INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:25] "GET /oauth2callback?state=/&code=4/1fDADaz3A-iyxRCl7OHNsGtIrsj2gB_V8JDC9oqoCtc HTTP/1.1" 302 - INFO _internal.py:87] 127.0.0.1 - - [10/Nov/2016 21:46:25] "GET / HTTP/1.1" 200 -

I would say to double check your settings for GOOGLE_OAUTH2_REDIRECT_URI and make sure they match with: http://<domain or public_ip>/oauth2callback

Also, to get more info on your server output you could add the --verbose flag to see more of what's going on when you authenticate.

Again, I am not certain what the issue or issues might be but I hope I can help you get to where you need to be. Dpxdt is an amazing tool.

cmrockwell commented 7 years ago

Thank you so much! There was a mistake in the the settings.cfg. It was missing :5000/oauth2callback in the domain in SESSION_COOKIE_DOMAIN and GOOGLE_OAUTH2_REDIRECT_URI

weeksghost commented 7 years ago

Great! @cmrockwell glad we were able to get you squared.