appcfg.py request_logs certificate verify failed (_ssl.c:661) - python-2.7

We've been using appcfg.py request_logs to download GAE logs, every once in a while it throws the error:
httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
But after a few times trying it works out, sometimes also it works after updating gcloud using gcloud components update. We thought it might be some network throttling issue of some kind and didn't give it enough thought. Lately though, we're trying to figure out what is causing this.
The full command we use is:
appcfg.py request_logs -A testapp --version=20180321t073239 --severity=0 all_logs.log --append --no_cookies
It seems the error is related to httplib2 library, but since it is part of the appcfg.py calls we're not sure we should tamper with something within its calls
Versions:
Python 2.7.13
Google Cloud SDK 196.0.0
app-engine-python 1.9.67

This has become more persistent now and I couldn't download logs for a few days now no matter how many times I try.
Looking at the download logs command I tried the same command again but without the --no_cookies flag to see what would happen.
appcfg.py request_logs -A testapp --version=20180321t073239 --severity=0 all_logs.log --append
I got the error:
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u'e~testapp').
--- end server output ---
Which lead me to the answer provided here https://stackoverflow.com/a/34694577/1394228 by #ninjahoahong. This worked for me and logs where downloaded from first trial in case someone faces the same issue
There's also this Google Group post which I didn't try but seems like it does the same thing.
Not sure if removing the file ~/.appcfg_oauth2_tokens would have other effects, yet to find out.
Update:
I also found out that my httplib2 located at /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2 was version = "0.7.5", I upgraded it to version = '0.11.3' using target location(directory) upgrade command:
sudo pip2 install --upgrade httplib2 -t /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/

Related

Logstash Google Pubsub Input Plugin fails to load file and pull messages

I'm getting this error when trying to run Logstash pipeline with a configuration that is using google_pubsub on a docker container running in my production env:
2021-09-16 19:13:25 FATAL runner:135 - The given configuration is invalid. Reason: Unable to configure plugins: (PluginLoadingError) Couldn't find any input plugin named 'google_pubsub'. Are you sure this is correct? Trying to load the google_pubsub input plugin resulted in this error: Problems loading the requested plugin named google_pubsub of type input. Error: RuntimeError
you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command
no such file to load -- com/google/cloud/google-cloud-pubsub/1.37.1/google-cloud-pubsub-1.37.1 (LoadError)
2021-09-16 19:13:25 ERROR Logstash:96 - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
This seems to randomly happen when re-installing the plugin. I thought it's a proxy issue but I have the google domain enabled in the whitelist. Might be the wrong one / missing something. Still, doesn't explain the random failures.
Also, when I run the pipeline in my machine I get GCP events, but when I do it on a VM - no Pubsub messages are being pulled. Could it be a firewall rule blocking them?
The error message suggests there is a problem in loading the ‘google_pubsub’ input plugin. This error generally occurs when the input Pub/Sub plugin is not installed properly. Kindly ensure that you are installing the Logstash Plugin for Pub/Sub correctly.
For example, installing Logstash Plugin for Pub/Sub in a VM :
sudo -u root sudo -u logstash bin/logstash-plugin install logstash-input-google_pubsub
For a detailed demo refer to this community tutorial.

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/free/win-64/repodata.json.bz2>

I'm setting up the virtual environment of Django for the first time. I've downloaded the Anaconda library of Python in my D drive. So initially I set up the path of Python and Conda(Scripts) manually in advance system settings. But now when I'm creating the environment using command
conda create --name mydjang0 django
the command prompt is showing an error like this-
C:\Users\AABHA GAUTAM> conda create --name mydjang0 django
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/pro/win-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/pro/win-64/repodata.json.bz2 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))'))
If you already have a .condarc file in your root folder. Then update the file by running this command.
conda config --set ssl_verify false
If you do not have a .condarc file, then create one and then run the above command. I have added both the commands below.
conda config --add channels conda-forge
conda config --set ssl_verify false
Instead of using command prompt use Anaconda Prompt as administator.
run the same command there.
I also faced same issue with command prompt.
Only delete file .condrac from c:\users\user

Why am I getting this error in AWS Device farm? Tests skipped due to test package parsing error. Please check Parsing result for more details

In AWS Device Farm, I created a new run. I chose native application. I uploaded my APK. I chose Calabash as the tests. I got this error message:
Tests skipped due to test package parsing error. Please check Parsing result for more details.
I downloaded the Parsing result. Here's what it said:
Failed to run cucumber dry-run command. See the information below for more details.
Here are the contents for the Parsing result:
'cucumber --dry-run --format json --out /tmp/scratchvxnAeX.scratch/tmpF6f5Xx' failed.
Could not find proper version of cucumber (2.99.0) in any of the sources
Run `bundle install` to install missing gems.
Solution
I have some .rb page objects. I added require 'calabash-android' to the top of those files. Then I made a new run and ran it. It worked.
How I got to the solution
Through Google I came across CALABASH_TEST_PACKAGE_DRY_RUN_FAILED here.
Running this command failed: cucumber-ios --dry-run --format json features
I figured that was for ios. So I tried this: bundle exec calabash-android run .\app-releaseStaging.apk --dry-run. I got this error:
uninitialized constant Calabash::ABase (NameError)
I wasn't getting that error when running locally.
According to this:
-d, --dry-run Invokes formatters without executing the steps. This also omits the loading of your support/env.rb file if it exists.
I had require 'calabash-android' inside env.rb. So I moved it to my page objects. Then it worked.
You may find the aws-device-farm-calabash-tests-for-sample-app useful.

Using Let's Encrypt on Amazon AMI (Centos) - can't even install package, any ideas?

Following instructions here : https://ivopetkov.com/b/let-s-encrypt-on-ec2/
I tried this : git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt /opt/letsencrypt/letsencrypt-auto --debug
and got the error: unknown option `debug'
I removed the --debug and got this error : Too many arguments.
So, I'm pretty much stuck in the water. I tried this a few months ago with a different tutorial and got further along but certbot itself returned a warning that using an Amazon AMI (which I am) is problematic.
I get this error when running ./certbot-auto for instance :
FATAL: Amazon Linux support is very experimental at present...
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!
Has anyone had luck setting up a Let's Encrypt SSL with an Amazon AMI ?
Thanks so much in advance for any suggestions.
This is one command, which clones the git repo into /opt/letsencrypt:
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
This is a second command, which runs the installer:
/opt/letsencrypt/letsencrypt-auto --debug
The formatting on the page you linked makes those look like one single command.

wso2 ​WSO2 Microservices Framework for Java petstore sample cannot run on ubuntu

I try to follow https://docs.wso2.com/display/MSS100/Running+as+an+MSA+Application to run petstore sample on ubuntu which is hosted on AWS.
I met several issues:
document is incorrect, it requires to download WSO2 Identity Server.
Unpack the .zip file and place the directory in the <MSS_HOME>/samples/petstore/deployment/packs directory. In fact, the
petstore.sh requires DAS 3.0. Just put wso2das-3.0.0.zip into<MSS_HOME>/samples/petstore/deployment/packs. The script will unzip
it.
kubectl. This script is not put into path, and cause it cannot be
executed when script changes to another folder.
cannot create docker, seems Creating Kube-System Namespace, Kube-DNS, Kube-UI
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
Hope you have done following
export KUBERNETES_MASTER=http://172.17.8.101:8080
Sometimes, if you previously tried out k8s, it will keep previous kubectl configuration under ~/.kube folder. Try removing that folder.
If you have installed some version of kubectl, remove it, otherwise kubectl client and server will not match. run.sh will download compatible kubectl version and install into /usr/local/bin/kubectl
Thanks for pointing out the documentation bug. We will fix it. Also please check out the instruction in https://github.com/wso2/msf4j/tree/v1.0.0/samples/petstore/deployment and ensure that all the prerequisites are met.
The docs are at https://docs.wso2.com/display/MSF4J100/Running+as+an+MSA+Application