Chef - Recipe package fails to find candidate version - jenkins

I am installing and configuring a very basic Jenkins installation using Chef. When i attempt to run the following recipe:
include_recipe "apt::default"
apt_repository "jenkins" do
uri "http://pkg.jenkins-ci.org/debian"
key "http://pkg.jenkins-ci.org/debian/jenkins-ci.org"
components ["binary/"]
action :add
end
package "jenkins" do
version '2.62'
end
service "jenkins" do
supports [:stop, :start, :restart]
action [:start, :enable]
end
I receive the following errors (displayed in the terminal):
192.168.9.207 [2017-05-25T10:50:58-04:00] ERROR: Running exception handlers
192.168.9.207 Running handlers complete
192.168.9.207 [2017-05-25T10:50:58-04:00] ERROR: Exception handlers complete
192.168.9.207 Chef Client failed. 2 resources updated in 20 seconds
192.168.9.207 [2017-05-25T10:50:58-04:00] INFO: Sending resource update report (run-id: 2b59b80e-b787-4e93-805b-837b4d3264fb)
192.168.9.207 [2017-05-25T10:50:58-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
192.168.9.207 [2017-05-25T10:50:58-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
192.168.9.207 [2017-05-25T10:50:58-04:00] ERROR: apt_package[jenkins] (jenkins-installation::default line 21) had an error: Chef::Exceptions::Package: No candidate version available for jenkins
192.168.9.207 [2017-05-25T10:50:58-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The error explains that there is no candidate version available for Jenkins. After the run fails, if I run sudo apt-get update on the managed node I receive the following error:
Err http://pkg.jenkins-ci.org trusty/binary/ amd64 Packages
404 Not Found
Err http://pkg.jenkins-ci.org trusty/binary/ i386 Packages
404 Not Found
Ign http://pkg.jenkins-ci.org trusty/binary/ Translation-en_US
Ign http://pkg.jenkins-ci.org trusty/binary/ Translation-en
Fetched 5,976 kB in 3s (1,528 kB/s)
W: Failed to fetch http://pkg.jenkins-ci.org/debian/dists/trusty/binary//binary-amd64/Packages 404 Not Found
W: Failed to fetch http://pkg.jenkins-ci.org/debian/dists/trusty/binary//binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
I am fairly new to Chef. This error appears to be related to retrieving a Jenkins package, however I am not sure how to remedy this error. Please let me know if additional information is required to troubleshoot this issue.
Thank you to everybody in advance for any guidance you are able to provide. I have searched through the Chef documentation but haven't seen much aside from specifying the package version: https://docs.chef.io/resource_package.html.

Specify distribution 'binary/' instead of components 'binary/'. This will fix the 404s that you get because of trusty/binary/.
At least, this is what I see from the "official" Jenkins cookbook, which I btw. suggest to use.
EDIT: So the result would be:
apt_repository "jenkins" do
uri "http://pkg.jenkins-ci.org/debian"
key "http://pkg.jenkins-ci.org/debian/jenkins-ci.org"
distribution "binary/"
end

Related

Issues with running remix Binary in Bazel sandbox

I've encountered an issue trying to use bazel as a build tool for remix. I've been able to run remix in dev mode but currently unable to get remix build to work.
I've encountered a few errors that led up to this point. I'll list the errors in the order which they occurred with my fixes (just incase any of the fixes introduces a new issue)
First error in the bazel sandbox is related to a transitive dependency of #remix-run/dev (#remix-run/dev->gunzip-maybe->browserify-zlib). Bazel failed to fetch the bazel repository #npm__browserify-zlib__0.1.4. I assumed this was a bazel issue and tried to override browserify-zlib#0.1.4 with browserify-zlib#0.2.0, which worked. Here is bazel error for reference:
ERROR: /Users/emmanuel/projects/bbbazel/WORKSPACE:89:17: fetching _npm_import rule //external:npm__browserify-zlib__0.1.4: Traceback (most recent call last):
File "/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/aspect_rules_js/npm/private/npm_import.bzl", line 471, column 27, in _impl
pkg_json = json.decode(rctx.read(pkg_json_path))
Error in decode: at offset 685, object has duplicate key: "main"
ERROR: /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/npm/BUILD.bazel:3012:6: #npm//:npm__browserify-zlib__0.1.4_source_directory depends on #npm__browserify-zlib__0.1.4//:source_directory in repository #npm__browserify-zlib__0.1.4 which failed to fetch. no such package '#npm__browserify-zlib__0.1.4//': at offset 685, object has duplicate key: "main"
Next error in the bazel sandbox is related to another transitive dependency of #remix-run/dev (#remix-run/dev->xdm->deasync). The install lifecycle hook for the deasync npm package makes a call to the node-gyp binary which doesn't exist in the sandbox and the bazel build command fails during setup. To fix this, I disabled the install lifecycle hook (I also disabled it with a pnpm install outside the sandbox and the remix build command executed perfectly) which led to the final error. Here's the error message for this error:
/Users/emmanuel/projects/bbbazel/BUILD.bazel:5:22: Running lifecycle hooks on npm package deasync#0.1.28 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //:.aspect_rules_js/node_modules/deasync#0.1.28/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh deasync ../../../external/npm__deasync__0.1.28/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found
node-gyp not found! Please upgrade your install of npm! You need at least 1.1.5 (I think) and preferably 1.1.30.
> deasync#0.1.28 install /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/deasync#0.1.28/node_modules/deasync
> node ./build.js
===============================================================
Failure while running lifecycle hook for package 'deasync#0.1.28':
Script: 'install'
Command: `node ./build.js`
Stack trace:
spawn ENOENT
at ChildProcess.<anonymous> (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
The final error suggests a bug with remix, but since it only occurs in the bazel sandbox I think it may be an issue that cuts across bazel and remix. The error returned is shown below:
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Missing output for entry point
Error
at Object.onCompileFailure (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:180:13)
at Object.compile (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/remixCompiler.js:34:134)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/build.js:33:3)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:175:3)
at async Object.run (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/run.js:449:7)
Building Remix app in production mode...
Target //examples/remix:build failed to build
I've tried to run it outside bazel and with pnpm (I added the override to the package.json for browserify-zlip#0.2.0, then I ran pnpm instal with --ignore-scripts flag) and it builds fine.
I'm not sure if this is a bug with remix or a bazel issue. Has anyone else experienced this? Or does anyone having a working version of remix with bazel as the build tool?
I've created a minified version of the repository in the state of the 3rd error https://github.com/noelenwenede/bbbazel. Start up instructions are in the readme file.

Tensorflow Hub Build from Source Failing

I'm having a problem with Building TF Hub from Source. Can Anyone please help me out? I've been following the steps as given in https://github.com/tensorflow/hub/blob/master/tensorflow_hub/pip_package/PIP.md
I've installed bazel 0.24.1.
Error I'm Getting:
ERROR: /home/tf_hub/hub/WORKSPACE:17:1: name 'git_repository' is not defined
ERROR: /home/tf_hub/hub/WORKSPACE:40:1: name 'http_archive' is not defined
ERROR: /home/tf_hub/hub/WORKSPACE:47:1: name 'new_http_archive' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '#bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '#bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
INFO: Elapsed time: 2.552s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Bazel Version: 0.24.1
Python Version: 3
Tensorflow Version: 2.0.0a
Commands to Reproduce:
(env)~/tf_hub$ git clone https://github.com/tensorflow/hub
(env)~/tf_hub$ cd hub && bazel build tensorflow_hub/pip_package:build_pip_package
Expected Output: No Error. Build Sucessful
Latest Versions of Bazel Doesn't support git_repository (which is still used by tensorflow_hub), so Uninstalling Bazel 0.24.1 and installing Bazel 0.18.1 worked.

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?

Unable to clone the repository in git_repository in bazel with ubuntu 15.10

I am trying to compile the following heron branch
https://github.com/twitter/heron/tree/karthik/pexbuild
using bazel 0.3.1 in ubuntu 15.10. In the workspace, I refer to another repo containing the pex bazel rules at
https://github.com/streamlio/bazel_rules_pex
I am getting the following error (interestingly it does not occur in ubuntu14.04, ubuntu16.10, centos7 and mac). Any help will be appreciated?
bazel build --config=ubuntu --verbose_failures heron/...
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'pex/pex_rules.bzl': no such package '#io_bazel_rules_pex//pex': Error cloning repository: https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by the trustAnchors parameter must be non-empty.
There were many fixes and improvements in remote repositories, I'd advice you to upgrade bazel before trying anything else.

Unit neo4j-service.service failed to load

installed neo4j 2.2.1 after first removing the previous version.
service neo4j-service start
produces the error:
Failed to start neo4j-service.service: Unit neo4j-service.service failed to load: No such file or directory.
System is:
system: os => {"name"=>"Ubuntu", "family"=>"Debian", "release"=>{"major"=>"15.04", "full"=>"15.04"}, "lsb"=>{"distcodename"=>"vivid", "distid"=>"Ubuntu", "distdescription"=>"Ubuntu 15.04", "distrelease"=>"15.04", "majdistrelease"=>"15.04"}}
Output of the install script:
root#cb-8:~# aptitude install neo4j -y # Install Neo4j, community edition
The following NEW packages will be installed:
daemon{a} neo4j
0 packages upgraded, 2 newly installed, 0 to remove and 0 not to upgrade.
Need to get 0 B/53.2 MB of archives. After unpacking 62.4 MB will be used.
Selecting previously unselected package daemon.
(Reading database ... 183856 files and directories currently installed.)
Preparing to unpack .../daemon_0.6.4-1_amd64.deb ...
Unpacking daemon (0.6.4-1) ...
Selecting previously unselected package neo4j.
Preparing to unpack .../archives/neo4j_2.2.1_all.deb ...
Unpacking neo4j (2.2.1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (219-7ubuntu3) ...
Setting up daemon (0.6.4-1) ...
Setting up neo4j (2.2.1) ...
update-rc.d: error: initscript does not exist: /etc/init.d/neo4j-service
dpkg: error processing package neo4j (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
neo4j
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package. Trying to recover:
Setting up neo4j (2.2.1) ...
update-rc.d: error: initscript does not exist: /etc/init.d/neo4j-service
dpkg: error processing package neo4j (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
neo4j
root#cb-8:~# service neo4j-service status
● neo4j-service.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
/etc/init.d/neo4j-service does in fact exist.
lrwxrwxrwx 1 root root 36 Mar 5 17:28 /etc/init.d/neo4j-service -> /opt/neo4j-community-2.1.7/bin/neo4j
I'm out of ideas and hoping someone might be able to point me in the right direction.
~ Ross
I had the same exact error. However, if installing newer version (3.3.0 in my case) of neo4j the syntax is different. It should be:
service neo4j start
not
service neo4j-service start
To double check you can do:
ls /etc/init.d | grep neo4j
In my case it finds neo4j
Problem solved.
2.2.1 was still linking to 2.1.7 somehow.
removed the spurious link and it all worked.

Resources