An error occurred during the fetch of repository 'maven': Traceback (most recent call last): - bazel

When i add the command
maven_install_json = "//:maven_install.json"
and when i run
bazel run #maven//:pin or bazel run #unpinned_maven//:pin"
I'm getting the below issue
Repository maven instantiated at:
C:/users/myil.s/ideaprojects/bazeltestverification/WORKSPACE:15:14: in <toplevel>
C:/users/myil.s/_bazel_myil.s/dcwwy5pe/external/rules_jvm_external/defs.bzl:130:30: in maven_install
Repository rule pinned_coursier_fetch defined at:
C:/users/myil.s/_bazel_myil.s/dcwwy5pe/external/rules_jvm_external/coursier.bzl:983:40: in <toplevel>
DEBUG: C:/users/myil.s/_bazel_myil.s/dcwwy5pe/external/rules_jvm_external/third_party/bazel_json/lib/json_parser.bzl:672:18: JSON parsing failed. None
ERROR: An error occurred during the fetch of repository 'maven':
Traceback (most recent call last):
File "C:/users/myil.s/_bazel_myil.s/dcwwy5pe/external/rules_jvm_external/coursier.bzl", line 335, column 13, in _pinned_coursier_fetch_impl
fail("Failed to parse %s. Is this file valid JSON? The file may have been corrupted." % repository_ctx.path(repository_ctx.attr.maven_insta
ll_json) +
Error in fail: Failed to parse C:/users/myil.s/ideaprojects/bazeltestverification/maven_install.json. Is this file valid JSON? The file may have been corru
pted.Consider regenerating maven_install.json with the following steps:
1. Remove the maven_install_json attribute from your `maven_install` declaration for `#maven`.
2. Regenerate `maven_install.json` by running the command: bazel run #maven//:pin 3. Add `maven_install_json = "//:maven_install.json"` into your `maven
_install` declaration.
ERROR: Error fetching repository: Traceback (most recent call last):
File "C:/users/myil.s/_bazel_myil.s/dcwwy5pe/external/rules_jvm_external/coursier.bzl", line 335, column 13, in _pinned_coursier_fetch_impl
fail("Failed to parse %s. Is this file valid JSON? The file may have been corrupted." % repository_ctx.path(repository_ctx.attr.maven_insta
ll_json) +
Error in fail: Failed to parse C:/users/myil.s/ideaprojects/bazeltestverification/maven_install.json. Is this file valid JSON? The file may have been corru
pted.Consider regenerating maven_install.json with the following steps:
1. Remove the maven_install_json attribute from your `maven_install` declaration for `#maven`.
2. Regenerate `maven_install.json` by running the command: bazel run #maven//:pin 3. Add `maven_install_json = "//:maven_install.json"` into your `maven
_install` declaration.
ERROR: no such package '#maven//': Failed to parse C:/users/myil.s/ideaprojects/bazeltestverification/maven_install.json. Is this file valid JSON? The file
may have been corrupted.Consider regenerating maven_install.json with the following steps:
1. Remove the maven_install_json attribute from your `maven_install` declaration for `#maven`.
2. Regenerate `maven_install.json` by running the command: bazel run #maven//:pin 3. Add `maven_install_json = "//:maven_install.json"` into your `maven
_install` declaration.
INFO: Elapsed time: 0.153s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

Related

Pre-commit causing the following error when trying to commit locally

I am working on a project and am required to use pre-commit.
After making a small code change, I tried to commit the change (in my local git repo). I got the following error:
dmk#DESKTOP-I1DLS2O:~/Markus$ git commit -m "Removed Grouping#marking_completed?"
[INFO] Installing environment for https://github.com/rubocop/rubocop.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Check the log at /home/dmk/.cache/pre-commit/pre-commit.log
Here is the log:
version information
pre-commit version: 2.19.0
git --version: git version 2.25.1
sys.version:
3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux
error information
An unexpected error has occurred: CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/usr/local/lib/python3.8/dist-packages/pre_commit/main.py", line 361, in main
return hook_impl(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/commands/hook_impl.py", line 238, in hook_impl
return retv | run(config, store, ns)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/commands/run.py", line 414, in run
install_hook_envs(to_install, store)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/repository.py", line 223, in install_hook_envs
_hook_install(hook)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/repository.py", line 79, in _hook_install
lang.install_environment(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/languages/ruby.py", line 133, in install_environment
helpers.run_setup_cmd(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/languages/helpers.py", line 51, in run_setup_cmd
cmd_output_b(*cmd, cwd=prefix.prefix_dir, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/util.py", line 146, in cmd_output_b
raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Other information:
I am working on a Rails project.
I am using WSL 2.
I am using Docker.
Please let me know if you require any other information.
it appears that your linux installation does not have a ruby executable (which pre-commit currently requires when language_version is not specified for language: ruby hooks)
you can install one on ubuntu/debian via sudo apt install ruby-dev
disclaimer: I created pre-commit

An error happen during Bazel build: no such package '#cc//': Not a regular file:

I just upgrade mac OS to macOS Big Sur (11), it is no issue to reinstall drake from source (./setup/mac/install_prereqs.sh). But some errors happen during "bazel built".
The message is posted below:
MacBook-Pro examples % bazel test ...
INFO: Repository cc instantiated at:
/Users/wc/drake/WORKSPACE:10:22: in <toplevel>
/Users/wc/drake/tools/workspace/default.bzl:311:29: in add_default_workspace
/Users/wc/drake/tools/workspace/default.bzl:110:22: in add_default_repositories
Repository rule cc_repository defined at:
/Users/wc/drake/tools/workspace/cc/repository.bzl:161:32: in <toplevel>
ERROR: An error occurred during the fetch of repository 'cc':
Traceback (most recent call last):
File "/Users/wc/drake/tools/workspace/cc/repository.bzl", line 58, column 33, in _impl
cc = repository_ctx.path(Label("#local_config_cc//:wrapped_clang"))
Error in path: Not a regular file: /private/var/tmp/_bazel_wc/ecfb0aaf3c5988894c5be550fe9d5e24/external/local_config_cc/wrapped_clang
ERROR: Error fetching repository: Traceback (most recent call last):
File "/Users/wc/drake/tools/workspace/cc/repository.bzl", line 58, column 33, in _impl
cc = repository_ctx.path(Label("#local_config_cc//:wrapped_clang"))
Error in path: Not a regular file: /private/var/tmp/_bazel_wc/ecfb0aaf3c5988894c5be550fe9d5e24/external/local_config_cc/wrapped_clang
INFO: Repository rules_python instantiated at:
/Users/wc/drake/WORKSPACE:10:22: in <toplevel>
/Users/wc/drake/tools/workspace/default.bzl:311:29: in add_default_workspace
/Users/wc/drake/tools/workspace/default.bzl:236:32: in add_default_repositories
/Users/wc/drake/tools/workspace/rules_python/repository.bzl:12:19: in rules_python_repository
/Users/wc/drake/tools/workspace/github.bzl:77:25: in github_archive
Repository rule _github_archive_real defined at:
/Users/wc/drake/tools/workspace/github.bzl:98:39: in <toplevel>
ERROR: no such package '#cc//': Not a regular file: /private/var/tmp/_bazel_wc/ecfb0aaf3c5988894c5be550fe9d5e24/external/local_config_cc/wrapped_clang
INFO: Elapsed time: 1.605s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
currently loading: examples/acrobot ... (3 packages

Permission denied with building angular-bazel-example with Bazel 0.21 on Windows

I am consistently seeing an error when I try to execute bazel run //src:devserver in the angular-bazel-example project.
I am using Windows 10. I haven't been able to find anything that fixes this. I thought the issue might be related to patch or to the path being too long. However, I've used MSYS2 to install patch, I've changed the output directory using the option --output_user_root, and I've tried using a DOS prompt with admin privileges. Nothing seems to help.
The error message
INFO: SHA256 (https://codeload.github.com/golang/tools/zip/3e7aa9e59977626dc60433e9aeadf1bb63d28295) = 2384fa91351a7414b643c5230422ce45f5aa2be8a82727609afd4e64e6973a30
ERROR: Analysis of target '//src:devserver' failed; build aborted: no such package '#org_golang_x_tools//go/gcexportdata': Traceback (most recent call last):
File "C:/temp/vvsv3266/external/bazel_tools/tools/build_defs/repo/http.bzl", line 55
patch(ctx)
File "C:/temp/vvsv3266/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 82, in patch
fail(("Error applying patch %s:\n%s%s...)))
Error applying patch #io_bazel_rules_go//third_party:org_golang_x_tools-gazelle.patch:
java.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(383): CreateProcessW("C:\msys64\usr\bin" -c "patch '-p1' < C:/temp/vvsv3266/external/io_bazel_rules_go/third_party/org_golang_x_tools-gazelle.patch"): Access is denied.
INFO: Elapsed time: 691.367s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (484 packages loaded, 20777 targets configured)
FAILED: Build did NOT complete successfully (484 packages loaded, 20777 targets configured)
Fetching #ngdeps; fetching 245s
Fetching #org_golang_x_tools; Patching repository 15s
Can someone please tell me how to remedy this?

Pytest fails on Travis: cannot find main package

I recently made a large swath of changes to a Python 3 project on Github, largely documentation and docstrings.
The tests pass locally, but when I push the branch to Github, Travis CI fails:
$ pytest
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 342, in _getconftestmodules
return self._path2confmods[path]
KeyError: local('/home/travis/build/scossu/lakesuperior')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 373, in _importconftest
return self._conftestpath2mod[conftestpath]
KeyError: local('/home/travis/build/scossu/lakesuperior/conftest.py')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/config.py", line 379, in _importconftest
mod = conftestpath.pyimport()
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/py/_path/local.py", line 668, in pyimport
__import__(modname)
File "/home/travis/virtualenv/python3.5.5/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 212, in load_module
py.builtin.exec_(co, mod.__dict__)
File "/home/travis/build/scossu/lakesuperior/conftest.py", line 6, in <module>
from lakesuperior.config_parser import test_config
ImportError: No module named 'lakesuperior.config_parser'
ERROR: could not load /home/travis/build/scossu/lakesuperior/conftest.py
The command "pytest" exited with 4.
lakesuperior is the main application package.
My .travis.yml:
language: python
python:
- "3.5"
- "3.6"
install:
- pip install -r requirements.txt
- coilmq&
script:
- pytest tests
The only thing that I think may have affected the import issue is that I added some __init__.py files to subpackages in order for Sphinx to discover API docs. I am not sure how that may have messed up CI though.
I verified that the previous commit passes all tests as it used to.
Has anybody encountered this scenario before? Any hints?
Thanks.
I recently had the same issue. I fixed it by removing the __init__.py file from the top level directory. See here.

Trigger.io error "/usr/bin/codesign no identity found" can't create package or run the app on the device

I have a problem when trying to run my application on the device or create IPA file.
I followed the steps here and I have this error when trying to run on iOS option:
[ERROR] Failed when running /usr/bin/codesign: FdawaDev: no identity found
I tried to make it throw terminal with this command
forge package ios --ios.profile.provisioning_profile Development.mobileprovision
and I'm getting this error
/Applications/TriggerToolkit.app/Contents/MacOS/forge -v package ios --ios.profile.provisioning_profile Development.mobileprovision
[ INFO] Forge tools running at version 3.3.43
[ DEBUG] Checking for update zip...
[ ERROR] Couldn't import generation code: No module named generate_dynamic
[ DEBUG] Traceback (most recent call last):
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/async.py", line 98, in run
result = self._target(*self._args, **self._kwargs)
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/main.py", line 443, in package
generate_dynamic = forge_build.import_generate_dynamic()
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/build.py", line 67, in import_generate_dynamic
raise ForgeError("Couldn't import generation code: {0}".format(e))
ForgeError: Couldn't import generation code: No module named generate_dynamic
I removed TriggerToolkit and download the latest one, installed it again and I'm still getting the same error.
What am I missing?
The first error is a configuration problem: you're pointing at an iOS developer identity called "FdawaDev" when one doesn't exist in your Keychain.
Unless you have several identities, you can safely leave the "Certificate" Local Config setting empty in the Toolkit.
If you have several identities, you should specify one with something like iPhone Developer: James Brady.
For the second problem, when using the command line tools, you have to manually run a build before doing a run or package action, e.g.:
% forge build ios && forge package ios

Resources