gcloud installation issues in cloudera VM - cloudera

I am trying to configure gcloud sdk in cloudera VM. Below commands I have used. I have tried to pass python a default parameter in install.sh but stil not working out. Can some one guide me any clean approach.
curl https://sdk.cloud.google.com | bash
1. I have installed python3.7 on the top of existing 2.6
(base) [cloudera#quickstart google-cloud-sdk]$ which python
alias python='/home/cloudera/anaconda3/bin'
(base) [cloudera#quickstart google-cloud-sdk]$ whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/bin/python2.6-config /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
(base) [cloudera#quickstart google-cloud-sdk]$
2. Error Log from sh -x install.sh
+ _cloudsdk_which python2
+ which python2
+ CLOUDSDK_PYTHON=python2
+ unset PYTHONHOME
+ case :$CLOUDSDK_PYTHON_SITEPACKAGES:$VIRTUAL_ENV: in
+ case " $CLOUDSDK_PYTHON_ARGS " in
+ CLOUDSDK_PYTHON_ARGS=-S
+ unset CLOUDSDK_PYTHON_SITEPACKAGES
+ export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS
+ '[' -z python2 ']'
++ id -u
+ '[' 501 = 0 ']'
+ python2 -S /home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py
Traceback (most recent call last):
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/setup.py", line 55, in <module>
from googlecloudsdk.core import properties
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 378
self.__sections = {section.name: section for section in sections}
^
3. After hardcoding the python as default.
+ echo Welcome to the Google Cloud 'SDK!'
Welcome to the Google Cloud SDK!
++ _cloudsdk_root_dir install.sh
++ case $1 in
+++ _cloudsdk_which install.sh
+++ which install.sh
+++ command -v install.sh
++ _cloudsdk_path=
++ case $_cloudsdk_path in
++ _cloudsdk_path=/home/cloudera/google-cloud-sdk/
++ _cloudsdk_dir=0
++ :
+++ readlink /home/cloudera/google-cloud-sdk/
++ _cloudsdk_link=
++ case $_cloudsdk_dir in
++ '[' -d /home/cloudera/google-cloud-sdk/ ']'
++ break
++ :
++ case $_cloudsdk_path in
+++ dirname /home/cloudera/google-cloud-sdk//.
++ _cloudsdk_path=/home/cloudera/google-cloud-sdk
++ :
++ case $_cloudsdk_path in
++ echo /home/cloudera/google-cloud-sdk
++ break
+ CLOUDSDK_ROOT_DIR=/home/cloudera/google-cloud-sdk
+ '[' -z '' ']'
+ CLOUDSDK_PYTHON=python
+ unset PYTHONHOME
+ case :$CLOUDSDK_PYTHON_SITEPACKAGES:$VIRTUAL_ENV: in
+ case " $CLOUDSDK_PYTHON_ARGS " in
+ CLOUDSDK_PYTHON_ARGS=-S
+ unset CLOUDSDK_PYTHON_SITEPACKAGES
+ export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS
+ '[' -z python ']'
++ id -u
+ '[' 501 = 0 ']'
+ python -S /home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py
Traceback (most recent call last):
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py", line 27, in <module>
from googlecloudsdk import gcloud_main
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/gcloud_main.py", line 37, in <module>
from googlecloudsdk.command_lib.util.apis import yaml_command_translator
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/command_lib/util/apis/yaml_command_translator.py", line 241
if self.spec.async:
^
SyntaxError: invalid syntax

Gcloud SDK works on 2.7 version or later but not python3. I had to install 2.7 and below the steps i performed.
1. Get python2.7 for anaconda
2. Install and provide an alernative path like /home/cloudera/anaconda2/
3. bash Anaconda2-2019.03-Linux-x86_64.sh
4. Update .bash_profile (alias python2.7='/home/cloudera/anaconda2/bin/python2.7')
5. Update CLOUDSDK_PYTHON="python2.7" in /home/cloudera/google-cloud-sdk/install.sh (Need to put after the if loop)
6. Then execute sh -x install.sh
Thanks

Related

parse erorr near '\n' in .zshrc file

When I open my MacOS terminal, it shows
Last login: Sun Jan 2 15:50:48 on ttys000
/Users/rajeshrao/.zshrc:18: parse error near `\n'
(base) rajeshrao#Rajeshs-MacBook-Air ~ %
I tried opening that .zshrc file which had this code in there ---->
export PATH="/usr/local/sbin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/rajeshrao/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/rajeshrao/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/rajeshrao/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/rajeshrao/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
<<<conda initialize<<<
here is the image of code
I don't know much about how shell works and am just a beginner. I didn't interfere with anything before using the terminal.
The last line has lost the initial '#' (ie. is not a comment).
Edit the file to end with this line:
# <<<conda initialize<<<

Incorrect application version. Expected version "XXX"

I have been trying to deploy my symfony2 project on aws elastic-beanstalk, but I keep having this error:
Command failed on all instances.
Incorrect application version found on all instances. Expected version "app-3706-170331_113756" (deployment 6).
.
i-02ac339ff8d24da60 Severe 3 hours 9 - - - - - - - - - - 0.00 0.00 0.1 0.1 99.8 0.0
Application update failed at 2017-03-31T10:40:17Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed.
+ . /opt/elasticbeanstalk/support/envvars
++ export HOME=/root
++ HOME=/root
++ export COMPOSER_HOME=/root
++ COMPOSER_HOME=/root
++ export PHP_MEMORY_LIMIT=2048M
++ PHP_MEMORY_LIMIT=2048M
++ export PHP_MAX_EXECUTION_TIME=4000
++ PHP_MAX_EXECUTION_TIME=4000
++ export PHP_DISPLAY_ERRORS=On
++ PHP_DISPLAY_ERRORS=On
++ export PHP_COMPOSER_OPTIONS=
++ PHP_COMPOSER_OPTIONS=
++ export PHP_ALLOW_URL_FOPEN=On
++ PHP_ALLOW_URL_FOPEN=On
++ export PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ export PHP_DOCUMENT_ROOT=
++ PHP_DOCUMENT_ROOT=
++ export PHP_DATE_TIMEZONE=UTC
++ PHP_DATE_TIMEZONE=UTC
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
+ cd /var/app/ondeck
+ '[' -f composer.json ']'
+ export COMPOSER_HOME=/root
+ COMPOSER_HOME=/root
+ '[' -d vendor ']'
++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
+ PHP_COMPOSER_OPTIONS=
+ echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
+ composer.phar install --no-ansi --no-interaction
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing twig/twig (v1.27.0)
Loading from cache
- Installing symfony/symfony (v2.8.13)
Loading from cache
- Installing symfony/security-acl (dev-master 053b49b)
Cloning 053b49bf4aa333a392c83296855989bcf88ddad1
Command output has been truncated. Please see logs for more details.
Incorrect application version "app-3706-170331_123438" (deployment 9). Expected version "app-3706-170331_113756" (deployment 6).
I have increased Max execution time up to 4000 and Memory limit up to 2048M.
In .ebextensions I have the following file:
project.config
files:
"/etc/php.d/symfony.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize = 256M
post_max_size = 256M
main.config
commands:
01_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
value: /root
01-increase-timeout.config
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 1000

pycadf error while installing devstack kilo in ubuntu

/usr/local/bin/keystone-manage db_sync
Traceback (most recent call last):
File "/usr/local/bin/keystone-manage", line 4, in
import('pkg_resources').require('keystone==2015.1.3.dev15')
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 3138, in
#_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 3124, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 3151, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 663, in _build_master
return cls._build_from_requirements(requires)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 676, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycadf<0.9.0,>=0.8.0' distribution was not found and is required by keystone
exit_trap
local r=1
++ jobs -p
jobs=
[[ -n '' ]]
kill_spinner
'[' '!' -z '' ']'
[[ 1 -ne 0 ]]
echo 'Error on exit'
Error on exit
[[ -z /opt/stack/logs ]]
/home/stack/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2016-01-08-084638.txt for details
exit 1
Log file: https://gist.github.com/anonymous/da3e29e34781fb2afc05
Even I was facing the same issue while running devstack. Looks like the pycadf lib is required for keystone.
I just had to install it: sudo pip install python-pycadf==0.6.0
and it worked for me.
Hope it works for you as well! Thanks.

Devstack installation fail at python update.py /opt/stack//cinder

i am new to openstack. while installing devstack on virtual box uisng ubuntu i am getting the following error. can any one help me to fix the problem. The error prompt is as follows.
cd /opt/stack/requirements
python update.py /opt/stack/cinder
Traceback (most recent call last):
File "update.py", line 505, in
main()
File "update.py", line 488, in main
options.hacking, stdout, options.verbose, non_std_reqs)
File "update.py", line 500, in _do_main
project, global_reqs, suffix, softupdate, hacking, non_std_reqs)
File "update.py", line 371, in _process_project
suffix, softupdate, hacking, project, global_reqs, non_std_reqs)
File "update.py", line 284, in _copy_requires
non_std_reqs)
File "update.py", line 255, in _sync_requirements_file
raise Exception("nonstandard requirement present.")
Exception: nonstandard requirement present.
+ exit_trap
+ local r=1
++ jobs -p
+ jobs=
+ [[ -n '' ]]
kill_spinner
'[' '!' -z '' ']'
[[ 1 -ne 0 ]]
echo 'Error on exit'
Error on exit
+ [[ -z /opt/stack/logs ]]
+ /home/faraz/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2015-06-21-174507.txt for details
+ exit 1

Using eclim with cygwin's vim

Fellow Eclim fans, I have been relegated to Windows, with cygwin as my only memory of a real operating system. Windows 7 is admittedly better than its predecessors, but I'm a pretty die-hard *nix fan. Anyway, I'm stuck. If anyone has any ideas, I'd be glad to hear them!
$ uname -a
CYGWIN_NT-6.1 AAXA22A492 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
$ vim --version | head -3
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 25 2014 19:00:15)
Included patches: 1-417
Compiled by <cygwin#cygwin.com>
$ cat .vimrc
" required for eclime (and general sanity):
set nocompatible
filetype plugin indent on
syntax on
set tabstop=3 shiftwidth=3 expandtab
set ic
$ tree -L 2 .vim
.vim
|-- eclim
| |-- autoload
| |-- bin
| |-- compiler
| |-- dict
| |-- doc
| |-- ftplugin
| |-- indent
| |-- plugin
| `-- syntax
`-- plugin
`-- eclim.vim
11 directories, 1 file
$ vim
Error detected while processing function <SNR>8_Init..eclim#LoadVimSettings..ecl
im#UserHome..eclim#cygwin#WindowsHome..<SNR>10_Cygpath..eclim#util#System..eclim
#util#EchoTrace:
line 7:
E121: Undefined variable: g:EclimHighlightTrace
E116: Invalid arguments for function <SNR>11_EchoLevel
Error detected while processing function <SNR>8_Init..eclim#LoadVimSettings..ecl
im#UserHome..eclim#cygwin#WindowsHome..<SNR>10_Cygpath:
line 6:
E171: Missing :endif
Error detected while processing function <SNR>8_Init..eclim#LoadVimSettings..ecl
im#UserHome..eclim#cygwin#WindowsHome:
line 2:
E171: Missing :endif
Error detected while processing function <SNR>8_Init..eclim#LoadVimSettings..ecl
im#UserHome:
line 3:
E171: Missing :endif
Press ENTER or type command to continue
Eric solved this problem on this thread -- solution copied below.
Thanks Eric!
--- a/org.eclim.core/vim/eclim/autoload/eclim.vim
+++ b/org.eclim.core/vim/eclim/autoload/eclim.vim
## -352,6 +350,11 ## function! eclim#ShutdownEclim() " {{{
endfunction " }}}
function! eclim#LoadVimSettings() " {{{
+ if !exists('g:EclimLogLevel')
+ let g:EclimLogLevel = 'info'
+ let g:EclimHighlightTrace = 'Normal'
+ endif
+
let settings_file = eclim#UserHome() . '/.eclim/.eclim_settings'
if filereadable(settings_file)
let lines = readfile(settings_file)
--- a/org.eclim.core/vim/eclim/autoload/eclim/client/nailgun.vim
+++ b/org.eclim.core/vim/eclim/autoload/eclim/client/nailgun.vim
## -153,7 +153,7 ## function! eclim#client#nailgun#GetEclimCommand(home) " {{{
if has('win32unix')
" in cygwin, we must use 'cmd /c' to prevent issues with eclim script +
" some arg containing spaces causing a failure to invoke the script.
- return 'cmd /c "' . eclim#cygwin#WindowsPath(command) . '"'
+ return [0, 'cmd /c "' . eclim#cygwin#WindowsPath(command) . '"']
endif
return [0, '"' . command . '"']
endfunction " }}}

Resources