google / upvote_py2

A multi-platform binary whitelisting solution
Apache License 2.0
452 stars 35 forks source link

bazel issue when trying to deploy to app engine #46

Open rishiv3 opened 5 years ago

rishiv3 commented 5 years ago

Please check the logs -

+ echo Configuring App Engine...
Configuring App Engine...
+ echo Deploying temporary default version to App Engine...
Deploying temporary default version to App Engine...
+ bazel run upvote/gae:monolith_binary.deploy -- upvote-project app.yaml
added 4 packages from 2 contributors and audited 4 packages in 3.854s
found 0 vulnerabilities

yarn install v1.12.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 0.48s.
added 4 packages from 2 contributors and audited 4 packages in 1.513s
found 0 vulnerabilities

added 4 packages from 2 contributors and audited 4 packages in 1.441s
found 0 vulnerabilities

external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc(2424): warning C4506: no definition for inline function 'google::protobuf::Message *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::NewFromPrototype(const GenericType *,google::protobuf::Arena *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc(2424): warning C4506: no definition for inline function 'google::protobuf::Arena *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::GetArena(GenericType *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc(2424): warning C4506: no definition for inline function 'void *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::GetMaybeArenaPointer(GenericType *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
external/com_google_protobuf/src/google/protobuf/map_field.cc(465): warning C4506: no definition for inline function 'google::protobuf::Message *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::NewFromPrototype(const GenericType *,google::protobuf::Arena *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
external/com_google_protobuf/src/google/protobuf/map_field.cc(465): warning C4506: no definition for inline function 'google::protobuf::Arena *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::GetArena(GenericType *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
external/com_google_protobuf/src/google/protobuf/map_field.cc(465): warning C4506: no definition for inline function 'void *google::protobuf::internal::GenericTypeHandler<google::protobuf::Message>::GetMaybeArenaPointer(GenericType *)'
        with
        [
            GenericType=google::protobuf::Message
        ]
+ echo

+ echo Deploying to App Engine...
Deploying to App Engine...
+ bazel run upvote/gae:monolith_binary.deploy -- upvote-project app.yaml santa_api.yaml
INFO: Invocation ID: bb4c697d-d1cf-48c9-9b5f-9b1cbf5c0006
Loading:
Loading: 0 packages loaded
DEBUG: Rule 'io_bazel_rules_appengine' modified arguments {"shallow_since": "1544654581 -0500"}
DEBUG: Rule 'build_bazel_rules_nodejs' modified arguments {"commit": "6d9a5c9333e5bca58125e9c96b99f3c274bf51e2", "shallow_since": "1543957109 -0800"} and dropped ["tag"]
Analyzing: target //upvote/gae:monolith_binary.deploy (0 packages loaded, 0 targets configured)
DEBUG: Rule 'gcloud_auth_git' modified arguments {"commit": "709953d34c0c93744606a38e84abce557e73dfcb", "shallow_since": "1492459993 -0700"} and dropped ["tag"]
DEBUG: Rule 'pyasn1_git' modified arguments {"shallow_since": "1444500249 +0000"}
DEBUG: Rule 'pyasn1_modules_git' modified arguments {"commit": "75a1d105027e86aa7d2720e6f0fa6349933ad55d", "shallow_since": "1501107647 +0200"} and dropped ["tag"]
DEBUG: Rule 'rsa_git' modified arguments {"shallow_since": "1497086972 +0200"}
DEBUG: Rule 'cachetools_git' modified arguments {"commit": "e27332bc82f4e327aedaec17c9b656ae719322ed", "shallow_since": "1475496371 +0200"} and dropped ["tag"]
DEBUG: Rule 'gcloud_auth_httplib2_git' modified arguments {"shallow_since": "1497375871 -0700"}
DEBUG: Rule 'gcloud_resumable_media_git' modified arguments {"commit": "d296d036453539f03b956f33112baa740d5a723f", "shallow_since": "1500660227 -0700"} and dropped ["tag"]
DEBUG: Rule 'requests_git' modified arguments {"commit": "5091c15bd71ec934423a71ce1b53668cd15db68f", "shallow_since": "1496094855 -0400"} and dropped ["tag"]
DEBUG: Rule 'chardet_git' modified arguments {"commit": "c47f6d79845ec7fe9f3bfd2fc66d47812f571d12", "shallow_since": "1492024800 -0400"} and dropped ["tag"]
DEBUG: Rule 'idna_git' modified arguments {"commit": "0088bfce9c3270e15d8356f0709110c1a9589d35", "shallow_since": "1488857158 -0800"} and dropped ["tag"]
DEBUG: Rule 'urllib3_git' modified arguments {"commit": "8e049799777cdf592ae54ae762d140151766123c", "shallow_since": "1500541470 +0100"} and dropped ["tag"]
DEBUG: Rule 'certifi_git' modified arguments {"commit": "4f35e3529c78ced74040cf5d80bf8ec4aac9a190", "shallow_since": "1492457773 -0400"} and dropped ["tag"]
DEBUG: Rule 'googleapiclient_git' modified arguments {"commit": "f19307d2079e3c3854cac887f059655a66c49896", "shallow_since": "1478045551 -0700"} and dropped ["tag"]
DEBUG: Rule 'oauth2client_git' modified arguments {"shallow_since": "1496765066 -0700"}
DEBUG: Rule 'absl_git' modified arguments {"shallow_since": "1506641175 -0700"}
DEBUG: Rule 'material_steppers' modified arguments {"shallow_since": "1491412933 -0300"}
DEBUG: C:/users/win/_bazel_win/pj2hik4j/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:159:5:
***********WARNING***********
npm: npm_install will require a package_lock_json attribute in future versions
*****************************
INFO: Analysed target //upvote/gae:monolith_binary.deploy (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Building: no action
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-bin -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-bin, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin): ERROR: src/main/native/windows/file-jni.cc(88): nativeCreateJunction(C:\users\win\desktop\upvote\upvote\bazel-bin, C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin): ERROR: src/main/native/windows/file.cc(346): DeviceIoControl(\\?\C:\users\win\desktop\upvote\upvote\bazel-bin): Access is denied.

  cannot create symbolic link bazel-testlogs -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/testlogs:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-testlogs, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\testlogs): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-genfiles -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/genfiles:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-genfiles, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\genfiles): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-out -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-out, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-upvote -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-upvote, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__): the junction's path got modified unexpectedly
[0 / 1] [-----] BazelWorkspaceStatusAction stable-status.txt
Target //upvote/gae:monolith_binary.deploy up-to-date:
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary_deploy.sh
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy.exe
INFO: Elapsed time: 35.375s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Running command line: C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy.exe upvote-project app.yaml santa_api.yaml
INFO: Build completed successfully, 1 total action
C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\upvote\gae\monolith_binary.deploy: line 34: cd: /tmp/war.WIYuYnvI/__main__: No such file or directory
C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\upvote\gae\monolith_binary.deploy: line 37: /c/users/win/_bazel~1/pj2hik4j/execroot/__main__/bazel-~1/x64_wi~1/bin/upvote/gae/monoli~2.run/../com_google_cloud_sdk/bin/gcloud: No such file or directory

I have updated all the dependencies but still not able to deploy it to app engine. Any ideas whats wrong here?

Thanks!

thehesiod commented 5 years ago

is this the latest version? seems old as deploying with app.yaml santa_api.yaml is no longer supported. Also latest bazel? I've been successfully deploying from my mac for awhile, however I had to add bazel run --incompatible_package_name_is_a_function=false

chief8192 commented 5 years ago

Hey Rishi, Can you post the exact command you're running which produces the log output above? Thanks!

rishiv3 commented 5 years ago

@thehesiod Yes, everything is up to date. Im using win10 machine right now but im going to try on mac. thanks!!

@chief8192 Hello Matt, Im following all the instructions (https://github.com/google/upvote/blob/master/docs/setup.md) and using this ./init_project.sh command to run.

chief8192 commented 5 years ago

Sorry for the radio silence.. Off the top of my head, could this be a permissions issue with where you're running init_project.sh, or who you're running it as? That "Access is denied" message in your stacktrace makes me wonder..

msuozzo commented 5 years ago

Yep +1 chief. Bazel will fall over pretty hard if it can't symlink in it's normal working/output directories.

On Mon, Feb 25, 2019, 15:16 Matt Doyle <notifications@github.com wrote:

Sorry for the radio silence.. Off the top of my head, could this be a permissions issue with where you're running init_project.sh, or who you're running it as? That "Access is denied" message in your stacktrace makes me wonder..

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/upvote/issues/46#issuecomment-467166189, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVBrLd3FPWNkc5aGlMZw_SLGV-Try3lks5vRESLgaJpZM4bDbjy .

rishiv3 commented 5 years ago

@chief8192 I am it as admin. Now there is no Access is denied error but still not able to deploy to gcp.

+ echo Deploying to App Engine...
Deploying to App Engine...
+ bazel run upvote/gae:monolith_binary.deploy -- rv3-upvote app.yaml santa_api.yaml
INFO: Invocation ID: 5bb62db2-51c7-442f-a39e-65ede043aa91
Loading:
Loading: 0 packages loaded
Analyzing: target //upvote/gae:monolith_binary.deploy (0 packages loaded, 0 targets configured)
INFO: Analysed target //upvote/gae:monolith_binary.deploy (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Building: no action
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-bin -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-bin, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-testlogs -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/testlogs:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-testlogs, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\testlogs): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-genfiles -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/genfiles:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-genfiles, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\genfiles): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-out -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-out, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out): the junction's path got modified unexpectedly
  cannot create symbolic link bazel-upvote -> C:/users/win/_bazel_win/pj2hik4j/execroot/__main__:  Cannot create junction (name=C:\users\win\desktop\upvote\upvote\bazel-upvote, target=C:\users\win\_bazel_win\pj2hik4j\execroot\__main__): the junction's path got modified unexpectedly
[0 / 1] [-----] BazelWorkspaceStatusAction stable-status.txt
Target //upvote/gae:monolith_binary.deploy up-to-date:
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary_deploy.sh
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy
  C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy.exe
INFO: Elapsed time: 11.304s, Critical Path: 0.02s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Running command line: C:/users/win/_bazel_win/pj2hik4j/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/upvote/gae/monolith_binary.deploy.exe rv3-upvote app.yaml santa_api.yaml
INFO: Build completed successfully, 1 total action
C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\upvote\gae\monolith_binary.deploy: line 34: cd: /tmp/war.slmlVbdN/__main__: No such file or directory
C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\upvote\gae\monolith_binary.deploy: line 37: /c/users/win/_bazel~1/pj2hik4j/execroot/__main__/bazel-~1/x64_wi~1/bin/upvote/gae/monoli~2.run/../com_google_cloud_sdk/bin/gcloud: No such file or directory
chief8192 commented 5 years ago

I'm guessing you need to install the Cloud SDK for that account as well?

C:\users\win\_bazel_win\pj2hik4j\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\upvote\gae\monolith_binary.deploy: line 37: /c/users/win/_bazel~1/pj2hik4j/execroot/__main__/bazel-~1/x64_wi~1/bin/upvote/gae/monoli~2.run/../com_google_cloud_sdk/bin/gcloud: No such file or directory

rishiv3 commented 5 years ago

@chief8192 sorry I didnt get your last comment.

and I have tried on the mac machine and it gives almost same error at the last step -

Initializing Upvote for GCP project: "rv3-upvote"
+ gcloud config set project rv3-upvote
Updated property [core/project].
+ echo Enabling App Engine...
Enabling App Engine...
++ gcloud app describe '--format=value(id)'
+ [[ rv3-upvote != \r\v\3\-\u\p\v\o\t\e ]]
+ echo Enabling APIs used by Upvote...
Enabling APIs used by Upvote...
+ gcloud services enable cloudkms.googleapis.com
+ gcloud services enable bigquery-json.googleapis.com
+ echo Granting necessary permissions to App Engine...
Granting necessary permissions to App Engine...
++ gcloud iam service-accounts list '--filter=App Engine app default service account' '--format=value(email)'
+ SERVICE_ACCOUNT=rv3-upvote@appspot.gserviceaccount.com
+ gcloud projects add-iam-policy-binding rv3-upvote --member serviceAccount:rv3-upvote@appspot.gserviceaccount.com --role roles/cloudkms.cryptoKeyEncrypterDecrypter
Updated IAM policy for project [rv3-upvote].
bindings:
- members:
  - serviceAccount:rv3-upvote@appspot.gserviceaccount.com
  role: roles/cloudkms.cryptoKeyEncrypterDecrypter
- members:
  - serviceAccount:rv3-upvote@appspot.gserviceaccount.com
  role: roles/editor
- members:
  - user:rishivishwakarma24x7@gmail.com
  role: roles/owner
etag: BwWC5oHngX4=
version: 1
+ echo Configuring App Engine...
Configuring App Engine...
+ ./manage_crons.py disable_all
+ echo Deploying temporary default version to App Engine...
Deploying temporary default version to App Engine...
+ bazel run upvote/gae:monolith_binary.deploy -- rv3-upvote app.yaml
+ echo

+ echo Deploying to App Engine...
Deploying to App Engine...
+ bazel run upvote/gae:monolith_binary.deploy -- rv3-upvote app.yaml santa_api.yaml
INFO: Analysed target //upvote/gae:monolith_binary.deploy (1 packages loaded, 22994 targets configured).
INFO: Found 1 target...
Target //upvote/gae:monolith_binary.deploy up-to-date:
  bazel-bin/upvote/gae/monolith_binary_deploy.sh
  bazel-bin/upvote/gae/monolith_binary.deploy
INFO: Elapsed time: 10.367s, Critical Path: 0.32s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
ERROR: (gcloud.app.deploy) [/private/var/folders/kz/pxyk18yx0536xkmp05v10qrm0000gn/T/war.lelB7jwb/__main__/rv3-upvote] does not exist.
richard-penshorn-praetorian commented 5 years ago

Was able to solve this by just running bazel run upvote/gae:monolith_binary.deploy rather than bazel run upvote/gae:monolith_binary.deploy -- "${PROJ_ID}" app.yaml santa_api.yaml