Unable to connect to cloud shell from GCP console - google-cloud-shell

I've been running into the following error for a while now when trying to connect to my Cloud Shell instance from the console:
Cloud Shell is experiencing some issues provisioning a VM to you. Please try again in a few minutes.
I get the following error when I try to SSH into the Cloud Shell from the CLI:
$gcloud cloud-shell ssh
Automatic authentication with GCP CLI tools in Cloud Shell is disabled. To enable, please rerun command with `--authorize-session` flag.
WARNING: The private SSH key file for gcloud does not exist.
WARNING: The public SSH key file for gcloud does not exist.
WARNING: The PuTTY PPK SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Pushing your public key to Cloud Shell...done.
Starting your Cloud Shell machine...
ERROR: (gcloud.cloud-shell.ssh) HttpError accessing <https://cloudshell.googleapis.com/v1/users/me/environments/default:start?alt=json>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'content-encoding': 'gzip', 'date': 'Wed, 07 Dec 2022 11:22:20 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"', 'transfer-encoding': 'chunked', 'status': 503}>, content <{
"error": {
"code": 503,
"message": "The service is currently unavailable.",
"status": "UNAVAILABLE"
}
}
>
This may be due to network connectivity issues. Please check your network settings, and the status of the service you are trying to reach.
Any thoughts on how i could resolve this?

Related

Horizon Access - Unable to create a new session key. It is likely that the cache is unavailable

I tried to access Horizon as recommended here, through the IP 10.20.20.1 and admin user, and received the following runtime error:
Request Method: | POST
-- | --
http://10.20.20.1/auth/login/
2.0.13
RuntimeError
Unable to create a new session key. It is likely that the cache is unavailable.
/snap/microstack/196/lib/python3.6/site-packages/django/contrib/sessions/backends/cache.py in create, line 51
/snap/microstack/196/bin/uwsgi
3.6.9
['.', '', '/snap/microstack/196/usr/lib/python36.zip', '/snap/microstack/196/usr/lib/python3.6',
'/snap/microstack/196/usr/lib/python3.6/lib-dynload', '/snap/microstack/196/usr/lib/python3/dist-packages',
'/snap/microstack/196/lib/python3.6/site-packages', '/snap/microstack/196/lib/python3.6/site-packages/openstack_dashboard']
Mon, 17 Aug 2020 12:42:48 +0000
The expected result would be a successful login.
Check on which address Memcached is running. With the command:
systemctl status memcached
And set that IP address in the local_settings.py mine it's located in /etc/openstack-dashboard/local_settings.py
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '192.168.122.2:11211',
},
}
I faced the same issue. For me, adding -l 10.20.20.1 (below -l 127.0.0.1) in /etc/memcached.conf and restarting memcached with systemctl restart memcached seemed to do the trick.

SSL error when creating vue.js app using api platform client generator

I tried to create client app of my API created using API Platform. I follow this guide https://api-platform.com/docs/client-generator/vuejs/.
I use Laravel Homestead for the VM when developing it.
I've added myapp .crt file to Keychan Access.
Problem was, when I try to execute
generate-api-platform-client --generator vue https://myapp-api.local/api src/
It return error message like this:
{
api: Api { entrypoint: 'https://myapp-api.local/api', resources: [] },
error: FetchError: request to https://myapp-api.local/api failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/Users/permana.jayanta/.config/yarn/global/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (events.js:209:13)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:209:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
name: 'FetchError',
message: 'request to https://myapp-api.local/api failed, reason: unable to verify the first certificate',
type: 'system',
errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
},
response: undefined,
status: undefined
}
I'm thinking this is related with SSL certificate. That node doesn't recognise the certificate. How to make node.js recognise the custom SSL certificate generated by Homestead?
it failed to verify https signature.
To disable it, type in shell
export NODE_TLS_REJECT_UNAUTHORIZED=0

How to fix failure to create function when deploying functions.pubsub.schedule

When I attempt to deploy the functions.pubsub.schedule like this on index.js:
const functions = firebase.functions;
var cronCount = 0;
exports.processPostsCron = functions.pubsub.schedule('* * * *
*').onRun(context => {
cronCount++;
console.log(`### this runs every minute. count: ${cronCount}`);
});
Error occured:
functions: failed to create function processPostsCron
HTTP Error: 400, The request has errors
How do I fix this error or am I doing it wrong?
I was referring to this https://github.com/firebase/functions-samples/blob/master/delete-unused-accounts-cron/functions/index.js
I am using firebase-admin#7.0.0 and firebase-functions#2.3.1.
Edit 1:
Debug result:
i functions: creating Node.js 8 function processPostsCron(us-central1)...
[2019-05-29T17:19:41.712Z] Trigger is: {"eventTrigger":{"resource":"projects/ticktock-d34b6/topics","eventType":"google.pubsub.topic.publish","service":"pubsub.googleapis.com"}}
[2019-05-29T17:19:41.714Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/ticktock-d34b6/locations/us-central1/functions
sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-f74bb5e4-12fb-4381-9f5a-ba9e11a921a8/2fac50ef-9d15-4390-8836-21209adfa8b4.zip?GoogleAccessId=service-1096541131355#gcf-admin-robot.iam.gserviceaccount.com&Expires=1559152179&Signature=EzcN7sYYs05vuTyVu7%2BMyJGU8viklA5VWPZRmMeASBCmlK6Xl%2BtMhL1G%2Fv4JHempDcLJ3FmvLDGPbar1iP%2BtNiApL%2B%2Fn6wjQINbF4CmpmqKnjxieBqpzkRYUD40zNMyCGbRDnkhcsps6DBpI9reiHvxdKkqYqadBPCaCn10nZwo96zaHcxZYHWg5PIo4cPLoPyOI7PTl4WYdwwt%2FzOHKlQSdyh1VuRgZqwfgy0vgDQR9HY846k0Tkg6RB6fGex8MzysUxiZ4RfPdt1i0LGd1KpY%2ByhG0OlEsMODQY3bBQ4TMh6LNbVyC2s9%2F0wJPkzAdJpnTjarf3hOgsF9908VkOg%3D%3D, name=projects/ticktock-d34b6/locations/us-central1/functions/processPostsCron, entryPoint=processPostsCron, deployment-tool=cli-firebase, deployment-scheduled=true, runtime=nodejs8, resource=projects/ticktock-d34b6/topics, eventType=google.pubsub.topic.publish, service=pubsub.googleapis.com
[2019-05-29T17:19:42.141Z] <<< HTTP RESPONSE 400 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Wed, 29 May 2019 17:19:42 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, connection=close
[2019-05-29T17:19:42.141Z] <<< HTTP RESPONSE BODY code=400, message=The request has errors, status=INVALID_ARGUMENT, details=[#type=type.googleapis.com/google.rpc.BadRequest, fieldViolations=[field=pubsub_topic, description=Pub/Sub topic name projects/ticktock-d34b6/topics does not match the expected pattern]]
⚠ functions: failed to create function processPostsCron
HTTP Error: 400, The request has errors
Functions deploy had errors with the following functions:
processPostsCron
To try redeploying those functions, run:
firebase deploy --only functions:processPostsCron
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
Seems like the error occurs from:
fieldViolations=[field=pubsub_topic, description=Pub/Sub topic name projects/ticktock-d34b6/topics does not match the expected pattern]]
Firebase Support has given me the instruction to update CLI and it's all good after update. Here's the command:
npm install -g firebase-tools#latest
It didn't worked for me at first, I have added 'unsafe-perm' option to proceed:
npm install -g firebase-tools#latest --unsafe-perm

After changing paswords in vault.yml, deployment fails in trellis

I had a wordpress site setup using Trellis. Initially I had set up the server and deployed without encrypting the vault.yml.
Once everything was working fine I changed the passwords in vault.yml and encrypted the file. But my deployment fails now.
And I get the following error-
TASK [deploy : WordPress Installed?]
**************************
System info:
Ansible 2.6.3; Darwin
Trellis version (per changelog): "Allow customizing Nginx `worker_connections`"
---------------------------------------------------
non-zero return code
Error: Error establishing a database connection. This either means that
the username and password information in your `wp-config.php` file is
incorrect or we can’t contact the database server at `localhost`. This
could mean your host’s database server is down.
fatal: [mysite.org]: FAILED! => {"changed": false,
"cmd": ["wp", "core", "is-installed", "--skip-plugins", "--skip-
themes", "--require=/srv/www/mysite.org/shared/tmp_multisite_constants.php"], "delta":
"0:00:00.224955", "end": "2019-01-04 16:59:01.531111",
"failed_when_result": true, "rc": 1, "start": "2019-01-04
16:59:01.306156", "stderr_lines": ["Error: Error establishing a
database connection. This either means that the username and password
information in your `wp-config.php` file is incorrect or we can’t
contact the database server at `localhost`. This could mean your host’s
database server is down."], "stdout": "", "stdout_lines": []}
to retry, use: --limit
#/Users/praneethavelamuri/Desktop/path/to/my/project/trellis/deploy.retry
Is there any step I missed? I followed these steps-
ansible-playbook server.yml -e env=staging
./bin/deploy.sh staging mysite.org
change passwords in staging/vault.yml
set vault password
inform ansible about password
encrypt the file
commit the file and push the repo
re deploy and then I get the error!
I got it solved. I have changed the sudo user password too in my vault. so ssh into server and changing sudo password to the password mentioned in vault and then provisioning it and then deploying solved the issue.

openwhisk postdeploy fails on single node ubuntu virtual machine

I am trying to run openwhisk serverless framework on a single node ubuntu vm.
I am following the instructions here.
I followed the instructions for database set up and then went over to the steps listed for ansible single node: (ansible/README.md)
Using the steps under "Deploy Using CouchDB", in the following step:
ansible-playbook -i environments/<environment> postdeploy.yml
I get an error in running installCatalog.sh
Looks like the URL 172.17.0.1 is not accesible. Where am I going wrong?
TASK [install the catalog from the catalog location] ***************************
Thursday 04 May 2017 10:41:29 +0000 (0:00:01.602) 0:00:09.063 **********
fatal: [ansible]: FAILED! => {"changed": true, "cmd": "./installCatalog.sh /home/techie/openwhisk/ansible/../ansible/files/auth.whisk.system 172.17.0.1 /whisk.system /home/techie/openwhisk/ansible/../bin/wsk", "delta": "0:00:01.840405", "end": "2017-05-04 10:41:32.380241", "failed": true, "rc": 7, "start": "2017-05-04 10:41:30.539836", "stderr": "error: Package update failed: Put 172.17.0.1/api/v1/namespaces/_/packages/websocket?overwrite=true: dial tcp 172.17.0.1:443: getsockopt: connection refused\nerror: Package update failed: Put 172.17.0.1/api/v1/namespaces/_/packages/combinators?overwrite=true: dial tcp 172.17.0.1:443: getsockopt: connection refused\nerror: Package update failed: Put 172.17.0.1/api/v1/namespaces/_/packages/watson-speechToText?overwrite=true: dial tcp 172.17.0.1:443: getsockopt: connection refused\nerror: Package update failed: Put 172.17.0.1/api/v1/namespaces/_/packages/utils?overwrite=true: dial tcp 172.17.0.1:443: getsockopt: connection refused\nerror: Package update failed:
.......
I ran docker ps after the deployment step. There were several dockers like zookeeper, kafka, etc. running. Is there supposed to be a nginx docker running too? In my set-up there was no nginx docker running.
In the config files, I have base url set to 172.17.0.1 - is this ok, or could it be something else?
I found that I needed to also run edge.yml after apigateway.yml and before postdeploy.yml to get the postdeploy script to work and then to be able to have the wsk tool work against the API endpoint.

Resources