google / loaner

Automated Chromebook loaner management
Apache License 2.0
170 stars 63 forks source link

Cannot access to the web app locally #96

Open StephaneConq opened 4 years ago

StephaneConq commented 4 years ago

Expected Behaviour

Being able to run the web app locally and log to it

Actual Behaviour

Python error when trying to log into the app :

Traceback (most recent call last): File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 311, in _LoadHandler handler, path, err = LoadObject(self._handler) File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject __import__(cumulative_path) File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/loaner/web_app/main.py", line 23, in <module> from loaner.web_app import constants File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/loaner/web_app/constants.py", line 23, in <module> import endpoints File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/endpoints_archive/endpoints/__init__.py", line 27, in <module> from .apiserving import * File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/endpoints_archive/endpoints/apiserving.py", line 75, in <module> from endpoints_management.control import client as control_client File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/google_endpoints_api_management_archive/endpoints_management/__init__.py", line 17, in <module> from . import auth, config, control, gen File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/google_endpoints_api_management_archive/endpoints_management/control/__init__.py", line 19, in <module> from ..gen import servicecontrol_v1_messages as sc_messages File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/google_endpoints_api_management_archive/endpoints_management/gen/servicecontrol_v1_messages.py", line 23, in <module> from apitools.base.py import encoding File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/google_apitools_archive/apitools/base/py/__init__.py", line 23, in <module> from apitools.base.py.credentials_lib import * File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/google_apitools_archive/apitools/base/py/credentials_lib.py", line 44, in <module> import fasteners File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/fasteners_archive/fasteners/__init__.py", line 23, in <module> from fasteners.lock import locked # noqa File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/fasteners_archive/fasteners/lock.py", line 24, in <module> from fasteners import _utils File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/fasteners_archive/fasteners/_utils.py", line 22, in <module> from monotonic import monotonic as now # noqa File "/home/stephane/.cache/bazel/_bazel_stephane/3c93c3d361a9b5691374ace7399fd91f/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/monotonic_archive/monotonic.py", line 169, in <module> raise RuntimeError('no suitable implementation for this system: ' + repr(e)) RuntimeError: no suitable implementation for this system: IOError(13, 'file not accessible')

Server starts correctly, I can go to http://localhost:8080, but this error occurs when trying to log to this page : image

Steps to Reproduce

I did all the steps until part 2 step 6. By the way, the app works normally on AppEngine.

AppEngine config

Google Cloud SDK 280.0.0 app-engine-python 1.9.88 app-engine-python-extras 1.9.87 bq 2.0.53 cloud-datastore-emulator 2.1.0 core 2020.02.07 gsutil 4.47

Bazel config

Build label: 2.1.0 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Fri Feb 7 13:01:04 2020 (1581080464) Build timestamp: 1581080464 Build timestamp as int: 1581080464

My config

Distributor ID: Ubuntu Description: Ubuntu 19.10 Release: 19.10 Codename: eoan

helfrichmichael commented 4 years ago

You're using way too new of a version of Bazel. Please use 0.26.1.

https://github.com/google/loaner/blob/master/docs/gngsetup_part2.md#step-1-set-up-a-development-computer covers this. Give that a try and let me know if you're still having issues.

StephaneConq commented 4 years ago

Did not read that correctly indeed Yet I now have another error :

Traceback (most recent call last): File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 311, in _LoadHandler handler, path, err = LoadObject(self._handler) File "/home/stephane/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject __import__(cumulative_path) File "/home/stephane/.cache/bazel/_bazel_stephane/58a4323a4f6f7345100c61402a4cf47a/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/loaner/web_app/main.py", line 23, in <module> from loaner.web_app import constants File "/home/stephane/.cache/bazel/_bazel_stephane/58a4323a4f6f7345100c61402a4cf47a/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/loaner/web_app/constants.py", line 26, in <module> import endpoints File "/home/stephane/.cache/bazel/_bazel_stephane/58a4323a4f6f7345100c61402a4cf47a/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/endpoints_archive/endpoints/__init__.py", line 27, in <module> from .apiserving import * File "/home/stephane/.cache/bazel/_bazel_stephane/58a4323a4f6f7345100c61402a4cf47a/execroot/gng/bazel-out/k8-fastbuild/bin/loaner/web_app/runfiles.runfiles/gng/external/endpoints_archive/endpoints/apiserving.py", line 69, in <module> from . import api_config ImportError: cannot import name api_config

helfrichmichael commented 4 years ago

What commit are you using from GitHub git log should provide this commit info? I would personally recommend master right now since 0.7.1a has some issues I've seen with compiling. We should hopefully be cutting a numbered release soon.

StephaneConq commented 4 years ago

Thanks again for your answer, I've been using this commit :

commit ab5e35d20052168ea80d80c411eee85a65e6be99 Author: Mike Helfrich me@michaelhelfrich.com Date: Mon Oct 7 11:18:16 2019 -0400

Internal change.

PiperOrigin-RevId: 273295181
helfrichmichael commented 4 years ago

@StephaneConq yeah, that commit probably won't work without some additional modifications (due to changes in packages we are reliant on). I'd recommend swapping to the master branch. We fixed much of the OSS build in https://github.com/google/loaner/commit/5f898ff618273df7ddef71c916430f915db9c48d. The master branch will include that commit.

You can see our branches here.

StephaneConq commented 4 years ago

Hi,

Sorry for the late answer, I was on another project. So I followed your call and based myself on the latest commit on master :

Author: Mike Helfrich me@michaelhelfrich.com Date: Wed Apr 1 13:33:24 2020 -0400

CHANGE: Set Travis CI to update apt before installing packages. This should resolve Chrome being viewed as unauthenticated.

PiperOrigin-RevId: 304214060

But I still have the first error when logging in (the RuntimeError: no suitable implementation for this system: IOError(13, 'file not accessible') error)

Everything is up to date, Bazel is at the correct version. Thanks in advance for yourr help.

helfrichmichael commented 4 years ago

Is that error only occurring when you try to run the local server or also when you do a dev push?

StephaneConq commented 4 years ago

No that error only occurs when trying to login in local server with dev_appserver.py

helfrichmichael commented 4 years ago

I found this article, but haven't had a chance to investigate/try this.

It looks like it might be caused by a newer version of Google Cloud SDK. If you feel comfortable trying to troubleshoot this using that article, feel free to let us know if it resolves the issue. Otherwise, it will be a bit before I can look into this probably.