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

subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1. #621

Closed
hrnbot opened this issue Jun 22, 2022 · 10 comments
Labels
type:build/install Cannot build/install the plugin

Comments

@hrnbot
Copy link

hrnbot commented Jun 22, 2022

Plugin Version or Commit ID

v0.9.0

Unity Version

2020.3.18

Your Host OS

Windows 10 Pro

Target Platform

Android

Target Device

Windows Docker

[Windows Only] Visual Studio C++ and Windows SDK Version

No response

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

No response

Build Command

python build.py build --android arm64 -vv

Bug Description

I am using Windows Docker for Build I am getting errors like this while building

python build.py build --android arm64 -vv
INFO (build.py): Building protobuf sources... DEBUG (build.py): Runningbazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs Loading: 0 packages loaded Fetching @llvm-raw; fetching 23s Loading: 0 packages loaded Loading: 0 packages loaded Fetching @llvm-raw; fetching 125s Loading: 0 packages loaded Fetching @llvm-raw; fetching 158s INFO: Repository llvm-raw instantiated at: /home/mediapipe/WORKSPACE:428:14: in <toplevel> /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/tensorflow/workspace3.bzl:52:9: in workspace /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/llvm/workspace.bzl:10:20: in repo /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:126:21: in tf_http_archive Repository rule _tf_http_archive defined at: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:79:35: in <toplevel> WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz failed: class java.io.IOException Read timed out ERROR: An error occurred during the fetch of repository 'llvm-raw': Traceback (most recent call last): File "/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl", line 66, column 33, in _tf_http_archive_impl ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz, https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/llvm-raw/temp9024392170098480921/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz: Read timed out ERROR: /home/mediapipe/WORKSPACE:428:14: fetching _tf_http_archive rule //external:llvm-raw: Traceback (most recent call last): File "/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl", line 66, column 33, in _tf_http_archive_impl ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz, https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/llvm-raw/temp9024392170098480921/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz: Read timed out ERROR: no such package '@llvm-raw//utils/bazel': java.io.IOException: Error downloading [https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz, https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/llvm-raw/temp9024392170098480921/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz: Read timed out INFO: Elapsed time: 163.313s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) Traceback (most recent call last): File "/home/mediapipe/build.py", line 436, in <module> Argument().command().run() File "/home/mediapipe/build.py", line 117, in run self._run_command(self._build_proto_srcs_commands()) File "/home/mediapipe/build.py", line 54, in _run_command return subprocess.run(' '.join(command_list), check=True, shell=shell) File "/usr/lib/python3.10/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1.

Steps to Reproduce the Bug

Clone repo and checkout to v0.9.0
switch to linux containers
docker build -t mediapipe_unity:linux . -f docker/linux/x86_64/Dockerfile

docker run --cpus=2 --memory=12g --mount type=bind,src=%CD%\Packages,dst=/home/mediapipe/Packages --mount type=bind,src=%CD%\Assets,dst=/home/mediapipe/Assets -it mediapipe_unity:linux

python build.py build --android arm64 -vv

Log

image

Screenshot/Video

No response

Additional Context

No response

@hrnbot hrnbot added the type:bug Something isn't working label Jun 22, 2022
@homuler
Copy link
Owner

homuler commented Jun 23, 2022

First, make sure you can download https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz.
If you cannot download it, you need to fix your network problem.

Otherwise, it may be that your network is too slow.
How about running python build.py build --bazel_build_opts "--experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0" --android arm64 -vv? (cf. #536 (comment))

@homuler homuler added type:build/install Cannot build/install the plugin and removed type:bug Something isn't working labels Jun 23, 2022
@hrnbot
Copy link
Author

hrnbot commented Jun 23, 2022

I am Unable to Download https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz tried various Proxies and Network network is 100Mbps but not downloading. @homuler

Even unable to download from semote servers of different regions.

@hrnbot
Copy link
Author

hrnbot commented Jun 23, 2022

and for the command python build.py build --bazel_build_opts "--experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0" --android arm64 -vv

I am getting error like
usage: build.py [-h] {build,clean,uninstall} ... build.py: error: unrecognized arguments: --bazel_build_opts --experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0

@homuler
Copy link
Owner

homuler commented Jun 23, 2022

I see. It looks like the target is removed.
It seems that you're using v0.9.0, but as written in the issue template, try the latest commit.

  • Make sure you're using the latest version.

@hrnbot
Copy link
Author

hrnbot commented Jun 23, 2022

Yes because my code runs on that build.

@homuler homuler added the stat:awaiting response Awaiting response from author label Jun 23, 2022
@moarorleslie
Copy link

Facing this issue as well. Is 0.9.x unbuildable since the target is removed? I need to stay on Unity 2020.3.x and saw that latest release uses Unity 2021.3

@hrnbot hrnbot closed this as completed Jun 23, 2022
@homuler
Copy link
Owner

homuler commented Jun 24, 2022

@moarorleslie

Is 0.9.x unbuildable since the target is removed?

I don't know. At least, it still can be built in my environment (although we need to use bazel 5.2.0 to work around #620 ).
It seems that usually another mirror site would be picked up and the resource be downloaded at last.

I need to stay on Unity 2020.3.x and saw that latest release uses Unity 2021.3

The sample scenes are only tested with Unity 2021.3, but the exported package should work fine with Unity 2020.3.x.

@KaramBelmoujoud
Copy link

KaramBelmoujoud commented Jun 24, 2022

i'm using the lastest comit and getting the same error.

[mediapipe@06bb9f526efa ~]$ python build.py build --android arm64 -vv
INFO (build.py): Building protobuf sources...
DEBUG (build.py): Running bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs
Starting local Bazel server and connecting to it...
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'rules_python' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "73106859751c2bc314861adc136d5cbecee3f7ae7d05539dc8235efbf4efdcbe"
DEBUG: Repository rules_cc instantiated at:
/home/mediapipe/WORKSPACE:90:13: in
Repository rule http_archive defined at:
/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in
INFO: Analyzed target //mediapipe_api:mediapipe_proto_srcs (102 packages loaded, 1252 targets configured).
INFO: Found 1 target...
INFO: From Compiling src/google/protobuf/message_lite.cc [for host]:
In file included from /usr/include/string.h:535,
from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
from external/com_google_protobuf/src/google/protobuf/stubs/common.h:48,
from external/com_google_protobuf/src/google/protobuf/message_lite.h:45,
from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
In function 'void* memcpy(void*, const void*, size_t)',
inlined from 'uint8_t* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, uint8_t*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:706:16,
inlined from 'virtual uint8_t* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(uint8_t*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:84:28,
inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:412:30:
/usr/include/bits/string_fortified.h:29:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
30 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: /home/mediapipe/mediapipe_api/calculators/util/BUILD:62:17: Executing genrule //mediapipe_api/calculators/util:detection_label_id_to_text_calculator_cs failed: (Exit 127): bash failed: error executing command
(cd /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/sandbox/processwrapper-sandbox/189/execroot/mediapipe_api &&
exec env -
PATH=/home/mediapipe/.cache/bazelisk/downloads/bazelbuild/bazel-5.2.0-linux-x86_64/bin:/home/mediapipe/.npm-packages/bin:/home/mediapipe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
mkdir -p bazel-out/k8-opt/bin
bazel-out/host/bin/external/com_google_protobuf/protoc --proto_path=. --proto_path=bazel-out/k8-opt/bin --proto_path=$(pwd)/external/com_google_protobuf/src --proto_path=$(pwd)/external/com_google_mediapipe --csharp_out=bazel-out/k8-opt/bin mediapipe/calculators/util/detection_label_id_to_text_calculator.proto
mv bazel-out/k8-opt/bin/DetectionLabelIdToTextCalculator.cs $(dirname bazel-out/k8-opt/bin/mediapipe_api/calculators/util/DetectionLabelIdToTextCalculator.cs)
')
Configuration: 5bc79e698554396b72b5903a55749cf17a8b795382c49b33c74c1b2f0dfe3a15
Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/bin/bash: line 1: $'\r': command not found
ERROR: /home/mediapipe/mediapipe_api/framework/BUILD:109:17: Executing genrule //mediapipe_api/framework:calculator_cs failed: (Exit 127): bash failed: error executing command
(cd /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/sandbox/processwrapper-sandbox/186/execroot/mediapipe_api &&
exec env -
PATH=/home/mediapipe/.cache/bazelisk/downloads/bazelbuild/bazel-5.2.0-linux-x86_64/bin:/home/mediapipe/.npm-packages/bin:/home/mediapipe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
mkdir -p bazel-out/k8-opt/bin
bazel-out/host/bin/external/com_google_protobuf/protoc --proto_path=. --proto_path=bazel-out/k8-opt/bin --proto_path=$(pwd)/external/com_google_protobuf/src --proto_path=$(pwd)/external/com_google_mediapipe --csharp_out=bazel-out/k8-opt/bin mediapipe/framework/calculator.proto
mv bazel-out/k8-opt/bin/Calculator.cs $(dirname bazel-out/k8-opt/bin/mediapipe_api/framework/Calculator.cs)
')
Configuration: 5bc79e698554396b72b5903a55749cf17a8b795382c49b33c74c1b2f0dfe3a15
Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/bin/bash: line 1: $'\r': command not found
Target //mediapipe_api:mediapipe_proto_srcs failed to build
INFO: Elapsed time: 124.658s, Critical Path: 74.55s
INFO: 283 processes: 98 internal, 185 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
Traceback (most recent call last):
File "/home/mediapipe/build.py", line 459, in
Argument().command().run()
File "/home/mediapipe/build.py", line 109, in run
self._run_command(self._build_proto_srcs_commands())
File "/home/mediapipe/build.py", line 54, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1.

i did try to use this command :

python build.py build --bazel_build_opts "--experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0" --android arm64 -vv

but it return this as well :

ERROR: /home/mediapipe/mediapipe_api/calculators/audio/BUILD:33:17: Executing genrule //mediapipe_api/calculators/audio:rational_factor_resample_calculator_cs failed: (Exit 127): bash failed: error executing command
(cd /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/sandbox/processwrapper-sandbox/279/execroot/mediapipe_api &&
exec env -
PATH=/home/mediapipe/.cache/bazelisk/downloads/bazelbuild/bazel-5.2.0-linux-x86_64/bin:/home/mediapipe/.npm-packages/bin:/home/mediapipe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
mkdir -p bazel-out/k8-opt/bin
bazel-out/host/bin/external/com_google_protobuf/protoc --proto_path=. --proto_path=bazel-out/k8-opt/bin --proto_path=$(pwd)/external/com_google_protobuf/src --proto_path=$(pwd)/external/com_google_mediapipe --csharp_out=bazel-out/k8-opt/bin mediapipe/calculators/audio/rational_factor_resample_calculator.proto
mv bazel-out/k8-opt/bin/RationalFactorResampleCalculator.cs $(dirname bazel-out/k8-opt/bin/mediapipe_api/calculators/audio/RationalFactorResampleCalculator.cs)
')
Configuration: 5bc79e698554396b72b5903a55749cf17a8b795382c49b33c74c1b2f0dfe3a15
Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/bin/bash: line 1: $'\r': command not found
Target //mediapipe_api:mediapipe_proto_srcs failed to build
INFO: Elapsed time: 0.400s, Critical Path: 0.04s
INFO: 17 processes: 17 internal.
FAILED: Build did NOT complete successfully
Traceback (most recent call last):
File "/home/mediapipe/build.py", line 459, in
Argument().command().run()
File "/home/mediapipe/build.py", line 109, in run
self._run_command(self._build_proto_srcs_commands())
File "/home/mediapipe/build.py", line 54, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures --experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0 //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1.

Also i am able to download https://github.com/llvm/llvm-project/archive/a87782c34d667d1c1a18fe82a9a7abfc72fd345b.tar.gz

@homuler
Copy link
Owner

homuler commented Jun 25, 2022

@KaramBelmoujoud

/bin/bash: line 1: $'\r': command not found

We don't call these things the same error.
See https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#binbash-line-1-r-command-not-found.

When an error occurred, check out the Troubleshooting page first.

@KaramBelmoujoud
Copy link

i don't know if this is a personal issue or related to building in Windows 11 but referring to clone this way
git clone ....... --config core.autocrlf=input
could solve the issue from the start for
/bin/bash: line 1: $'\r': command not found

@homuler thank you for your support and for your patience

@homuler homuler removed the stat:awaiting response Awaiting response from author label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Cannot build/install the plugin
Projects
None yet
Development

No branches or pull requests

4 participants