Openshift - "Unable to connect to gear" when running: rhc show-app <app> --gear quota - openshift

I created an app called "world" following the instructions from:
https://blog.openshift.com/12-tips-for-hosting-wordpress-on-openshift/.
It's a hosted Wordpress blog, with PHP 5.4 scalable up to 1GB, with a Web Load Balancer and MySQL 5.5.
Everytime I try to check for the space used, I get the same error.
rhc show-app world --gears quota
Unable to connect to gear 54d48383fcf933f91f0000aa#54d48383fcf933f91f0000aa-laurapons.rhcloud.com
Unable to connect to gear 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
Gear Cartridges Used Limit
------------------------ ------------------- ----- -----
54d48383fcf933f91f0000aa mysql-5.5 error 1 GB
54d48383fcf933f91f0000a9 haproxy-1.4 php-5.4 error 1 GB
I tried to restart the application (using restart and stop&start commands) but nothing seems to work.
I am also facing some other connection problems (probably related to the same issue):
I have the same problem when trying to clone the application with git clone:
ssh: connect to host world-laurapons.rhcloud.com port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
And also with the rhc port-forward world
I copied the URL for git clone from the openshift online dashboard, and I can open the wordpress blog and see all the information, but somehow, I'm unable to access to the data.
I have already created a default Public Key and 2 authorisations (one to access through the browser and the other to access through RHC)...
What should I try?
How can I get the usage?
Do I need to set up anything else?
I am stuck... any suggestion?

Sounds like your SSH key is not working properly. Make sure you installed your keys and that they are working. Try running 'rhc setup'. If that still doesn't work try
ssh -vvv 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
and look at the output.
You can also try using
ssh -i /path/to/your/ssh.key 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
And see if that works (specifies what ssh key to use)

rhc with some ruby version will have issue with pageant (putty). I closed pageant, ran again rhc command then it worked.

Related

Internal 500 error on Google Compute Engine, installing littlest jupyter

"Internal 500 server error" after VM runs for a day or two.
This is the second time it has happened, I start the instance, install littlest Jupyterhub
(see details below). I can login to the external ip, for a day, but then it stops
with internal 500 error. I cannot ssh or get into the instance, only alternate is to
create a new instance and re-do. What is the problem?
I have installed littlest jupyterhub using on this instance, using
#!/bin/bash
curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin master
I would recommend you enable access on your instance to the serial console [1].
You will also need to setup a password for your user following this documentation [2].
With these two steps done, you should be able to reconnect to your instance once you are locked out like you mentioned by following this [3].
You should then be able to investigate what is going on in the instance.
Then try to verify if your application is still running, if the SSH server is still running etc.
Frederic
[1] https://cloud.google.com/compute/docs/instances/interacting-with-serial-console#enable_instance_access
[2] https://cloud.google.com/compute/docs/instances/interacting-with-serial-console#setting_up_a_local_password
[3] https://cloud.google.com/compute/docs/instances/interacting-with-serial-console#connectserialconsole

How do I resolve this error when trying to connect to an SQL server hosted on a Google Compute Engine Ubuntu VM

For a database course that I'm in, the professor has tasked us with setting up several VM MySQL servers and remote connections. I've found proper documentation to solve most of my problems, but I've pored over docs trying to find a solution to my latest issue.
I've set up an Ubuntu VM on the Google Cloud Compute Engine. I installed a MySQL server to this VM instance, and I need to log in remotely from my laptop. I've followed this documentation https://cloud.google.com/solutions/mysql-remote-access and this youtube video https://www.youtube.com/watch?v=f5qQDm3ciDg.
However, I still get an Unable to Connect to Server message when I test my connection. What could I be overlooking that will help me connect?
Thanks!
So, I slammed my head against a wall for long enough to realize that ssh will be an easier solution than a direct connection.
So, at least for my Windows machine, these are the steps I followed to make the connection:
Download the sql server (You don't need to add a user unless necessary, and you don't change the bind-address in the config file).
Use PuTTYgen to create a private public key pair. Export the private key as an openssh format (in the export options)
Click the edit button on your VM instance then scroll down to the SSH key section.
Paste the public key into the text box (be sure to change the last comment portion to a username on the Linus VM)
Use the SSH connection on MySQL Workbench. Use the external IP of your VM as the first (ssh) host name and localhost as the second (SQL) host name. Input all other info as it is asked for.

Ejabberd user registration command fails with {error,access_rules_unauthorized}

I've been trying to set up an XMPP server using ejabberd on windows. every time I try to register a user in ejabberd with this command:
ejabberdctl register admin localhost admin
it gives me this error:
{error,access_rules_unauthorized}
I've installed the ejabberd using its binary installer and according to "install.log" file, the installer also fails to create a user due to the same error.
Part of the log file:
E:\Program Files\ejabberd-16.08\bin>bash ejabberdctl register "admin" "localhost" "admin"
{error,access_rules_unauthorized}
ejabberd.yml config file:
access_rules:
register:
- allow
I've gone even to the 100th search of the google, but found nothing similiar yet. So any help on how to fix this is strongly appreciated.
Try version 16.06 instead of 16.08 from downloads archive https://www.process-one.net/en/ejabberd/archive/ It solved my issue on Centos.
It seems like this is an error in ejabberd 16.08 and has been fixed in the git master.
For the corresponding issue, see https://github.com/processone/ejabberd/issues/1231.
Version 16.06 work for me in windows10, before installation keep firewall off.

rake db:migrate runs in development AWS Beanstalk

I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there).
On my development environment I can run the rails application with my local Mysql (it is just a basic application I've created for experimentation).
I have added the passenger gem to Gemfile and bundled, but I'm using WEBBrick in development still.
The only thing I did not do by the book is that I did not use 'eb' but rather tried from the console. My application/environment failed to run as while "rake db:migrate" it still thinks I wanted it to connect to the local Mysql (I guess from the logs that it is not aware of RACK_ENV and hence uses 'development').
Any tip? I can of course try next the 'eb', yet would prefer to work with the console.
Regards,
Oren
In Elastic Beanstalk (both the web console and the cli), you can pass environnement variables. If you pass the RAKE_ENV variable, you will change your environnement.
After that you still need to pass your database parameters (db password, name, ...) which should not be hardcoded into the code.
Have you tried to run
bin/rake db:migrate RAILS_ENV=development
?
I got the same issue and that worked for me.
I recommend you enter to EC2 instance through this command "eb ssh" (The first time you need specified you .pem file, if you have not one you can create in IAM services) and check your logs for more information about yours error.
If you have problems when you are uploading your code (eb deploy) you have the log in this file: "/var/log/eb-activity.log" (Remember this file is in your EC2 instance)
If you have a problems with your app, you can read the logs in this files: "/var/app/support/logs/production.log" or "/var/app/support/logs/passenger.log"
Other recommedations is install EB CLI version 3. for manage your eb instance
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html
I believed that Elastic Beanstalk will run 'rake db:migrate' by itself. Indeed it seems to try, but that is failing. I gave my bounty to 'Yahs Hef', even though I will only try this evening (UK). My disorientation with AWS caused me to forget this easy solution, of running the migration by myself. If this does not work by itself, I'll simplify the database configuration as possibile.

Cannot connect to Google Compute Instance user

I have searched all over google for this issue but found no answere yet, so I thought asking here.
I have a google compute instance and I had a running putty ssh connection that worked flawlessly. But after I formatted my PC, everything went wrong.
I installed gcloud and done the whole procces of ssh again (config-ssh, adding ssh to key list and trying to connect), also I was trying to connect to my old user after I realized that I typed a different name to my windows user name. Suddenly I got the No supported authentication message. So I thought something is wrong with the ssh keys, But I realized that I cannot connect to my user even through the google web browser window, the connection is always stuck on trying to connect until timeout.
I would gladly appreciate any help :)
gcloud compute ssh currently has a known problem and might not work on Windows.
Here's a workaround until we fix it: run "gcloud compute ssh INSTANCE --dry-run". This will output the command it tries to execute.
Copy that command. You can either add -W flag to it and run it, or replace ssh.exe with ssh-term.exe and remove the -o flags.
If gcloud is installed in a place like Program Files, you might also need to add "" around the path.
First of all, run the following command (replacing the word in capital letters) which will ensure that your SSH key is created if it was not created before: gcloud compute ssh INSTANCE
Then, follow these steps to add your SSH key to your project and SSH into your instance:
1- Copy the content of C:\Users\<username>\.ssh\ google_compute_engine.pub(might be different path based on each Windows version) into the project metadata (Developers Console -> PROJECT -> Compute -> Metadata -> SSH keys -> Edit -> Add key).
If you want to log in as a different user, you can do it modifying it in the last word of the pasted text: <username>#<hostname>
2- Configure Putty. Go to Connection -> SSH -> Auth -> Browse and select your Putty SSH key which should be located in C:\Users\<username>\.ssh\ google_compute_engine.ppk)and try to SSH into the instance.
3- If it doesn't work, remove the instance metadata because the instance metadata overrides the project metadata. To do that, go to Compute-> Compute Engine-> INSTANCE -> SSH keys -> Edit -> Click on every ‘x’ and save the changes.
Regarding your issue trying to access using the SSH button in the Developers Console, I’d reboot the instance if it’s not in production because there is a script that must be working properly in order to access from there: /usr/bin/python /usr/share/google/google_daemon/manage_accounts.py --daemon
I hope it helps.