Setting up Vagrant/Puppet on a mac - virtualbox

I have found a lot of great resources to set up virtualbox, vagrant and puppet. However I have hit a snag and don't understand where to go from here. I am not a sys admin or super man developer.
I go to run vagrant up and it loads almost everything with the exception of getting this error.
I have search for an answer but to no avail.
Running Puppet with ubuntu-apache2-sqlite-php5.pp...
stdin: is not a tty
Error: Could not find class apache for www.envisioncomm.net on node www.envisioncomm.net
Error: Could not find class apache for www.envisioncomm.net on node www.envisioncomm.net
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
FACTER_fqdn='dev.pyrocms-pro.sqlite' FACTER_hostname='www' FACTER_docroot='/vagrant /www/pyrocms-pro/' puppet apply --hiera_config /vagrant/hiera.yaml --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' --manifestdir /tmp/vagrant-puppet/manifests --detailed-exitcodes /tmp/vagrant-puppet/manifests/ubuntu-apache2-sqlite-php5.pp || [ $? -eq 2 ]
Stdout from the command:
Stderr from the command:
stdin: is not a tty
Error: Could not find class apache for www.envisioncomm.net on node www.envisioncomm.net
Error: Could not find class apache for www.envisioncomm.net on node www.envisioncomm.net
I have a feeling this might deal with the vhost but not sure. I am still figuring it out.
Any help would be appreciated.

Related

Solana Anchor framework: Can't connect to localhost and therefor not deply to it

Anchor deploy
Deploying workspace: http://localhost:8899
Upgrade authority: /home/tomcatzy/.config/solana/id.json
Deploying program "basic-1"...
Program path: /home/tomcatzy/projects/anchor/examples/tutorial/basic-1/target/deploy/basic_1.so...
Error: RPC request error: cluster version query failed: error sending request for url (http://localhost:8899/): error trying to connect: tcp connect error: Connection refused (os error 111)
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
solana config set --url http://localhost:8899 (Is this enough to start the localhost ?)
solana-keygen new
solana-test-validator
It seems strange that after a succesful anchor build that i can't do a anchor deploy with the solana command lines ran above.
If by any means 'need' to run a - npm init - then where to do it ?
solana config set --url http://localhost:8899 (Is this enough to start the localhost ?)
solana-keygen new
solana-test-validator
I tried the above and got generated a keypair: keyname_1-keypair.json. The build went succesful but the deploy not !
I'm wondering why not ?
Hopefully some can guide me what to get it succed...
In a separate window / terminal, you need to run solana-test-validator so that the tools can talk to your local network. The error you're seeing on deployment is due to an error on connecting to that network.
By following the Solana docs and doing this
sudo $(command -v solana-sys-tuner) --user $(whoami) > sys-tuner.log 2>&1 &
https://docs.solana.com/running-validator/validator-start#system-tuning
The test-ledger folder is done and a sys-tuner.log file is created but it's 0 bytes...
Then i run the solana-test-validator in a separate terminal and the other solana config commands in another termianl then i get the following results ->
You can deploy on-chain programs with the Solana tools.
To deploy a program, you will need the location of the program's shared object.
It will return when you run anchor build in the command line.
Run solana program deploy <PROGRAM_FILEPATH>.
Successful deployment will return the program id of your program.

CentOS - No route to host when trying git clone

I'm trying to clone a repo from github by using the command:
git clone https://github.com/
However, I'm getting the below error:
fatal: unable to access "https://github.com/...." : Failed connect to ip addr : port; No route to host
I have tried several things including turning the firewall off.
systemctl status firewalld
shows inactive status.
Does anyone have an idea what I might be missing here?
Check if the system has access to internet. It can be a problem with the nameserver. It should be defined here: /etc/resolv.conf

Passenger doesn't seem to be running (Capistrano/Rails/Nginx/Ubuntu)

I'm deploying my app in Ubuntu 14.4, Ruby 2.3.3, Nginx and Passenger. When I deploy using capistrano, I get the error:
SSHKit::Command::Failed: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.
Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as user#IP-Address: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.
I have tried several suggestions such as: https://www.pistolfly.com/weblog/en/2016/01/passenger-config-and-passenger-status-result-in-an-error-on-centos7.html
Passenger doesn't seem to be running (Capistrano/Rails/Apache/Ubuntu)
But nothing helped! I have checked my Nginx default_sites to see if I point to current rails path and everything looks correct.
Any help is appreciated!
This issue was fixed by adding restart.txt in my_app_name/current/tmp:
*It's done in the server:
*touch my_app_name/current/tmp/restart.txt
And add:
set :passenger_restart_with_touch, true in deploy.rb
UPDATE
In the newest version of capistrano, this is taken care of by gem 'capistrano-passenger' and adding adding require 'capistrano/passenger' in your capfile

Fab Deploy Error: '"Error log: [emerg] 8780#0: invalid server name or wildcard "mydomain*.mydomain.com" on 0.0.0.0:80"'

I've been stuck on this deployment error for days, help! Our project is in the last step of deployment cd to the /home/django/django_project directory and run "fab deploy". Our project errors out on the supervisorctl start my_app: gunicorn command within our "fabfile.py" with the follow error code.:
"[555.555.55.555] out: my_app:gunicorn_my_app: ERROR (abnormal termination) "
Below are error logs.
/home/django/django_project/deploy
:: Important configuration files in this directory **nginx.conf**
/etc/supervisor/conf.d
:: Important configuration files in this directory **my_app.conf**
/var/log/supervisor
:: Important error log files in this directory **supervisord.log**
"INFO spawned: 'gunicorn_my_app' with pid 11575
INFO exited: gunicorn_my_app (exit status 1; not expected)
INFO gave up: gunicorn_my_app entered FATAL state, too many start retries too quickly"
/var/log/nginx
:: Important error log files in this directory **error.log.1**
Error log: 2015/01/02 18:21:42 [emerg] 8780#0: invalid server name or wildcard "mydomain*.mydomain.com" on 0.0.0.0:80
I changed the server name variable in our nginx.conf file but for some reason it hasn't been updated when this command runs.
I probably can't help, but I'll throw some things out there.
You haven't provided any of your configs for nginx or gunicorn, which would be helpful. Perhaps you could provide those so others can take a look at them?
Gunicorn:
From the logs it seems like gunicorn is taking a poop somewhere in the process of attempting to launch. Perhaps a configuration error may be preventing the server from starting. If you haven't done so yet it's worth checking that your configs are kosher.
From the gunicorn configuration documentation:
To check your configuration when using the command line or the configuration file you can run the following command:
$ gunicorn my_app:gunicorn_my_app --check-config
It will also allow you to know if your application can be launched.
If everything comes back fine, then you can probably rule that out and take a deeper look. Gunicorn has a debug option that should let you see in great detail what exactly is going wrong. The docs say it can be done with the --debug option, like so:
$ gunicorn my_app:gunicorn_my_app --debug
Hopefully that should get you a little closer to understanding what's up.
Nginx:
I don't know if you're getting that nginx error every time you're trying to start the server, but I'll take a stab at what I can see in that error log.
Nginx only supports wildcard server names at beginning or the end of the name.
From the nginx documentation on server names:
A wildcard name may contain an asterisk only on the name’s start or end, and only on a dot border. The names “www..example.org” and “w.example.org” are invalid. However, these names can be specified using regular expressions, for example, “~^www..+.example.org$” and “~^w..example.org$”. An asterisk can match several name parts. The name “.example.org” matches not only www.example.org but www.sub.example.org as well.
To listen on mydomain*.mydomain.com, you would use a regular expression in the server_name directive in the server block of your nginx.conf file.
The following regular expression would achieve this:
^mydomain(\S*)\.mydomain\.com$
and you would put it in your nginx.conf like so:
server {
server_name ~^mydomain(\S*)\.mydomain\.com$;
}
And after saving any changes to your nginx.conf, always running this command is good practice:
$ sudo nginx -t
Just like gunicorn's --check-config, it parses your configuration files to check that there are no errors, and it will tell you if there are any that need fixing.
Apologies if this answer isn't ultimately useful.

ubuntu rabbitmq - Error: unable to connect to node 'rabbit#somename: nodedown

I am using celery for django which needs rabbitmq. Some 4 or 5 months back, it used to work well. I again tried using it for a new project and got below error for rabbitmq while listing queues.
Listing queues ...
Error: unable to connect to node 'rabbit#somename': nodedown
diagnostics:
- nodes and their ports on 'somename': [{rabbitmqctl23014,44910}]
- current node: 'rabbitmqctl23014#somename'
- current node home dir: /var/lib/rabbitmq
- current node cookie hash: XfMxei3DuB8GOZUm1vdUsg==
Whats the solution? If there is no good solution, can I uninstall and reinstall rabbitmq ?
I had installed rabbit as a service apparently and the
sudo rabbitmqctl force_reset
command was not working.
sudo service rabbitmq-server restart
Did exactly what I need.
P.S. I made sure I was the root user to do the previous command
sudo su
if you need change hostname:
sudo aptitude remove rabbitmq-server
sudo rm -fr /var/lib/rabbitmq/
set new hostname:
hostname newhost
in file /etc/hostname set new value hostname
add to file /etc/hosts
127.0.0.1 newhost
install rabbitmq:
sudo aptitude install rabbitmq-server
done
Check if the server is running by using this command:
sudo service rabbitmq-server status
If it says
Status of all running nodes...
Node 'rabbit#ubuntu' with Pid 26995:
running done.
It's running.
In my case, I accidentally ran the rabbitmqctl command with a different user and got the error you mentioned.
You might have installed it with root, try running
sudo rabbitmqctl stop_app
and see what the response is.
(If everything's fine, run
sudo rabbitmqctl start_app
afterwards).
Double check that your cookie hash file is the same
Double check that your machine name (uname) is the same as the one stated in your configuration — this one can be tricky
And double check that you start rabbitmq with the same user as the one you installed it. Just using 'sudo' won't do the trick.