"not a valid identifier" error when running Teaspoon - teaspoon

When running teaspoon, I'm getting the following errors:
rake teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:64790/teaspoon/default
sh: line 25: `BASH_FUNC_set_shell_label%%': not a valid identifier
Teaspoon running insight suite at http://127.0.0.1:64790/teaspoon/insight
sh: line 25: `BASH_FUNC_set_shell_label%%': not a valid identifier
Teaspoon running wb5 suite at http://127.0.0.1:64790/teaspoon/wb5
sh: line 25: `BASH_FUNC_set_shell_label%%': not a valid identifier
I haven't yet been able to identify which file's line 25 is the problem.

Related

Is it possible to selectively sync cookbooks with knife bootstrap?

I'm trying to get a server up and running via knife bootstrap via this command:
knife bootstrap "<ip-address>"
-x ec2-user
-r recipe[connector],recipe[all-servers]
-N "serv-name"
-E staging
-i "~/.chef/mycert.pem"
--sudo
--no-host-key-verify
The all-servers recipe includes dependencies for windows that are broken in chef 13+:
(TLDRS, full stack traces are at the bottom)
13: undefined method “kernel” (outdated 7-zip cookbook dependency 3.0 instead of 2.0)
14: cannot load such file -- chef/mixin/language (windows cookbook dependency, 3.0 + for windows cookbook would fix this)
15: manual license acceptance required and cannot load such file -- chef/mixin/language error (windows cookbook dependency, 3.0 + for windows cookbook would fix this)
The big problem is that a bunch of under-maintained services use the older versions and upgrading any of them is likely to cause multitudes of problems throughout the chef org, so I want to have just this server use a newer version of either the windows or 7-zip cookbook.
What I tried to do to solve for this was created a new cookbook "all-servers-dev" and created dev versions of all the cookbooks in the dependency tree all the way down to "windows" where I downloaded the updated windows cookbook and replaced it at the bottom of the dependency tree. This didn't work however because chef keeps trying to sync all cookbooks even the windows one even though it's not included anywhere in the dependency tree that I can find.
I even tried removing the all-servers recipe and just installing the connector recipe whose only dependency is yum-epel whose only dependency is "compat_resource" which has no dependencies.
13.12.14
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/seven_zip/attributes/default.rb
================================================================================
NoMethodError
-------------
undefined method `kernel' for #<Chef::Node::Attribute:xxxxxxxxxxxxxxxxx>
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/seven_zip/attributes/default.rb:21:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/seven_zip/attributes/default.rb:
14: # Unless required by applicable law or agreed to in writing, software
15: # distributed under the License is distributed on an "AS IS" BASIS,
16: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: # See the License for the specific language governing permissions and
18: # limitations under the License.
19: #
20:
21>> if kernel['machine'] =~ /x86_64/
22: default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514-x64.msi'
23: default['seven_zip']['checksum'] = 'xxxxxxxxxx'
24: default['seven_zip']['package_name'] = '7-Zip 15.14 (x64 edition)'
25: else
26: default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514.msi'
27: default['seven_zip']['checksum'] = 'xxxxxxxxxx'
28: default['seven_zip']['package_name'] = '7-Zip 15.14'
29: end
30:
System Info:
------------
chef_version=13.12.14
platform=amazon
platform_version=2017.03
ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
program_name=chef-client worker: ppid=3493;start=17:29:14;
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T17:29:32+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T17:29:32+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 17 seconds
[2019-12-04T17:29:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T17:29:32+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T17:29:32+00:00] ERROR: undefined method `kernel' for #<Chef::Node::Attribute:xxxxxxxxxx>
[2019-12-04T17:29:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
14.14.29
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/windows/libraries/windows_package.rb
================================================================================
LoadError
---------
cannot load such file -- chef/mixin/language
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:7:in `<top (required)>'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:
1: require 'chef/resource/lwrp_base'
2: require 'chef/provider/lwrp_base'
3:
4: require 'win32/registry' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
5:
6: require 'chef/mixin/shell_out'
7>> require 'chef/mixin/language'
8: class Chef
9: class Provider
10: class WindowsCookbookPackage < Chef::Provider::LWRPBase
11: include Chef::Mixin::ShellOut
12: include Windows::Helper
13:
14: # the logic in all action methods mirror that of
15: # the Chef::Provider::Package which will make
16: # refactoring into core chef easy
System Info:
------------
chef_version=14.14.29
platform=amazon
platform_version=2017.03
ruby=ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T18:06:28+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T18:06:28+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 35 seconds
[2019-12-04T18:06:28+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T18:06:28+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T18:06:28+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language
15.5.17
Chef has a new prompt that’s unhandled by knife bootstrap:
Do you accept the 2 product licenses (yes/no)?
You can’t accept these from the bootstrap CLI, so you have to ssh to the server and run chef manually which then results in the same error as 14:
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/windows/libraries/windows_package.rb
================================================================================
LoadError
---------
cannot load such file -- chef/mixin/language
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:7:in `<top (required)>'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:
1: require 'chef/resource/lwrp_base'
2: require 'chef/provider/lwrp_base'
3:
4: require 'win32/registry' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
5:
6: require 'chef/mixin/shell_out'
7>> require 'chef/mixin/language'
8: class Chef
9: class Provider
10: class WindowsCookbookPackage < Chef::Provider::LWRPBase
11: include Chef::Mixin::ShellOut
12: include Windows::Helper
13:
14: # the logic in all action methods mirror that of
15: # the Chef::Provider::Package which will make
16: # refactoring into core chef easy
System Info:
------------
chef_version=15.5.17
platform=amazon
platform_version=2017.03
ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T18:14:03+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T18:14:03+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 0 resources updated in 18 seconds
[2019-12-04T18:14:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T18:14:03+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T18:14:03+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language
15.5.17 Chef has a new prompt that’s unhandled by knife bootstrap:
Do you accept the 2 product licenses (yes/no)?
You can’t accept these from the bootstrap CLI, so you have to ssh to
the server and run chef manually
that is incorrect, you can use --chef-license accept when you bootstrap the node to accept the chef license
if i understood your right, you wish to pin the different versions of the same cookbooks collection. if that is the case, you can acheive it by using environment:
Cookbook versions can be pinned in each environment, which allows you to control the rollout of new cookbook releases through successive testing environments before releasing new cookbook versions into production environments. See the environment format examples below for the cookbook pinning syntax.
so just remember to associate your nodes with specific chef environment, such that each environment has its own cookbook collection.

Failure to Jack-in with spacemacs

I can run a repll and connect but when I try to Jack in I get the following error (shown in debug) - I am using emacs 26.1 on Mojave. I tried reinstalling spacemacs and updating clojure
Debugger entered--Lisp error: (error "Could not start nREPL server:
/usr/local/bin/lein: line 72: basename: command no$ signal(error
("Could not start nREPL server: /usr/local/bin/lein: line 72:
basename: command not found\n/usr/local/b$ error("Could not start
nREPL server: %s" "/usr/local/bin/lein: line 72: basename: command not
found\n/usr/local/bin/$ nrepl-server-sentinel(# "exited abnormally with code 127\n")

Restarting Jetty on Ubuntu 12.04.4

I'm getting some very unusual behaviour.
I followed these instructions for installing jetty but used the latest version instead (9.1.1v20140108)
I had reason to restart Jetty and found I was getting these errors (logged in as root)
Starting Jetty: FAILED Wed Feb 5 12:35:59 EST 2014
So I spent 30 mins looking for an answer, then for reasons I can't recall, I did service jetty check and it was running (had a pid).
So I tried again with service Jetty stop:
root#erp:/var/log# service jetty stop
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Stopping Jetty: start-stop-daemon: warning: failed to kill 7817: No such process
1 pids were not killed
No process in pidfile '/var/run/jetty.pid' found running; none killed.
OK
None killed? Ok. Let's check that:
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
START_INI = /srv/jetty/start.ini
JETTY_HOME = /srv/jetty
JETTY_BASE = /srv/jetty
JETTY_CONF = /srv/jetty/etc/jetty.conf
JETTY_PID = /var/run/jetty.pid
JETTY_START = /srv/jetty/start.jar
JETTY_LOGS = /srv/jetty/logs
CLASSPATH =
JAVA = /usr/bin/java
JAVA_OPTIONS = -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp
JETTY_ARGS = jetty.port=8085 jetty-logging.xml jetty-started.xml
RUN_CMD = /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 jetty-logging.xml jetty-started.xml
No PID? Let's check that:
root#erp:/var/log# service jetty start
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Starting Jetty: FAILED Wed Feb 5 12:39:43 EST 2014
Ok, is there a PID?
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
[edit]
Jetty running pid=7993
Weird. Sure enough, a stop and check will give the same results.
What's going on with the jetty startup script? And why am I getting FAILED errors on start which are incorrect, and fail to remove pid errors on stop which are also incorrect?
I have got a fix for all those who have been using that tutorial to install jetty
nano /etc/init.d/jetty
And change this syntax :
start-log-file="$JETTY_LOGS/start.log"
to
start-log-file="start.log"
It will fix everything in the latest jetty build and make it run like a charm.
Hope I could be of help
Ok, so this was a tricky one that was the result of a recent Java update.
I jumped into the jetty.sh at /etc/init.d/jetty and grabbed out the actually executed line:
$ /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state \
-Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty \
-Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 \
jetty-logging.xml jetty-started.xml
and I got this:
java.io.IOException: Cannot read file: modules/npn/npn-1.7.0_51.mod
at org.eclipse.jetty.start.Modules.registerModule(Modules.java:405)
at org.eclipse.jetty.start.Modules.registerAll(Modules.java:395)
at org.eclipse.jetty.start.Main.processCommandLine(Main.java:561)
at org.eclipse.jetty.start.Main.main(Main.java:102)
Which in turn lead me to this solution on the eclipse dev list:
$ cp /srv/jetty/modules/npn/npn-1.7.0_45.mod /srv/jetty/modules/npn/npn-1.7.0_51.mod
$ chown jetty:jetty /srv/jetty/modules/npn/npn-1.7.0_51.mod
Sure enough, Jetty restarted without hassle.
Try running below command in terminal.
sudo service jetty9 stop
I run Jetty 9.2.10.v201503 on pcDuino v3, Ubuntu 14.04. According to my experience with this relatively slow platform, this message may be reported when Jetty server itself starts longer than internal waiting loop in /etc/init.d/jetty script expects.
After adding “set –x” at the beginning of /etc/init.d/jetty file and running that script I noticed that internal waiting loop is implemented as “for” making 15 steps and periodically checking content of the $JETTY_BASE/jetty.state file.
After waiting additional couple of seconds, Jetty server is up and running ok, no errors/warrnings in log files.

Chef and redissio error

Maybe someone faced with the same situation
We have a clean instance on redis who try to put a chef
Default recipe has only
include_recipe "redisio :: install"
When I cook getting the following error
Enviroment AWS ec2.micro ubuntu 12.04
When I run cook to receive an error
================================================================================
Recipe Compile Error in /tmp/chef-solo/cookbooks/main/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:13:in `block in from_file'
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:12:in `from_file'
/tmp/chef-solo/cookbooks/redisio/recipes/install.rb:20:in `from_file'
/tmp/chef-solo/cookbooks/main/recipes/default.rb:11:in `from_file'
Relevant File Content:
----------------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:
6: # All rights reserved - Do Not Redistribute
7: #
8: ulimit = node['ulimit']
9:
10: case node[:platform]
11: when "debian", "ubuntu"
12: template "/etc/pam.d/su" do
13>> cookbook ulimit['pam_su_template_cookbook']
14: end
15: end
16:
[2013-04-06T14:09:50+00:00] ERROR: Running exception handlers
[2013-04-06T14:09:50+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2013-04-06T14:09:50+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
[2013-04-06T14:09:50+00:00] FATAL: NoMethodError: undefined method `[]' for nil:NilClass
ERROR: RuntimeError: chef-solo failed. See output above.
Resource https://github.com/Piom/redis-chef.git
I ran into this issue as well. I have one way to solve it but I am also just started looking into chef.
the issue is redisio depends on ulimit and looks like the recipe does not handle when you don't have any attributes for ulimit defined.
ulimit = node['ulimit']
try to get a hash of attributes but is getting nil. So if you define some attributes it should work.
there might be an updated version of the recipe since you downloaded it. If not in ulimit/attributes/default.rb I have default['ulimit']['pam_su_template_cookbook'] = nil and it worked for me.
ulimit let you limit resources. I think it can be used to limit redis resources. (again I am new too.) So the better way might be figure how you want to configure ulimit and set the correct attribute rather than nil

Budling GLEW with Cygwin fail

I need to build GLEW from source so I can use it with Mingw in Code::Blocks being Mingw doesn't like to use the one's they compile in VS. I'm using Cygwin and I download the source for GLEW here and unzip it. I then browse to the folder with Cygwin using cd. Then I run
make Makefile
It then gives me these errors.
config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: ` case $1 in
config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: ` case $1 in
Makefile:40: *** "Platform '' not supported". Stop.
I've read around and I haven't been able to find much useful on solving this problem yet. If you know a better way I can get GLEW working with Mingw that would also answer my question.
On Windows XP
Using Code::Blocks 10.05
Using Cygwin 1.7.16-1
Using GLEW 1.8.0
UPDATE
Those errors have been fixed using dos2unix on the config.guess file. However, when I run the Makefile now it says there is nothing to be done for it.
Looks very much like config.guess has DOS line endings ("\r\n") but make is expecting Unix line endings ("\n"). I would just run whatever tool on config.guess to convert it to Unix line endings, my cygwin has a tool called dos2unix that will do the trick.
If you just want to code and build under Windows refer to this topic Using GLEW to use OpenGL extensions under Windows
Sorry for the late reply on this, but setting a variable SYSTEM works in cygwin:
$ SYSTEM=cygwin make