gsutil doesn't work: "AttributeError: 'SymbolDatabase' object has no attribute 'RegisterServiceDescriptor'" - gsutil

The gsutil command in my VM is failing with the following error:
(...)
packages/google/iam/v1/iam_policy_pb2.py", line 296, in
_sym_db.RegisterServiceDescriptor(_IAMPOLICY)
AttributeError: 'SymbolDatabase' object has no attribute 'RegisterServiceDescriptor'
Ideas??

When did this issue start to appear, was it after a configuration change to this VM? If not because of a configuration change, below steps should help:
Please ssh into the instance and run below command to see which Cloud SDK version and gsutil version you’re using: 'gcloud version'
As it appears to be a gsutil issue it might help to update your gsutil:
'sudo gcloud components update gsutil'
Enter ‘N’ at the ‘Do you want to run install instead (y/N)?’ prompt and you should be able to update gsutil. You might have to use ‘sudo apt-get install google-cloud-sdk’ which should give you the same results, if Cloud SDK component manager is not enabled.
Check to see if above steps help.

Related

How to enable and disable yum repos using the command line

I'm attempting to edit the yum.repos.d file in order to disable unwanted repos and enable wanted repos without using the vi editor. Each time I use the method I know of it fails to make the changes. Does anyone know what I'm missing?
See Below:
yum-config-manager --disable \therepoid,anotherrepoid
Note: I'm not executing this from the yum.repos.d directory
First you need to run the command as root
Then you should get the list of repos:
yum repolist all
And then you can enable or disable particular repo(s) by repo_id from previous command
yum-config-manager --enable repo_id
For reference you can use RedHat documentation

Can't install GCloud on macOS Big Sur

Doing instructions step by step:
https://cloud.google.com/sdk/docs/quickstart
Unpacked archive
Running ./install.sh
Getting this message:
Welcome to the Google Cloud SDK!
And that's all.
command not found: gcloud
Is there any way to get it working?
I managed to install GCloud on my end and there should be an instruction to
Modify profile to update your $PATH and enable shell command
completion?
Do you want to continue (Y/n)?
Type in y and press Enter and the next lines of instructions will appear:
The Google Cloud SDK installer will now prompt you to update an rc
file to bring the Google Cloud CLIs into your environment.
Enter a path to an rc file to update, or leave blank to use
[/Users/{userName}/.bash_profile]:
Backing up [/Users/{userName}/.bash_profile] to [/Users/{userName}/.bash_profile.backup].
[/Users/{userName}/.bash_profile] has been updated.
==> Start a new shell for the changes to take effect.
Afterwards, you need to type exec bash -l to restart your terminal without closing it completely.
As an alternative, here are some related links that you might find useful for setting up your GCloud on your macOS for x86/x64 and M1 chips:
Install GCloud for Mac
Install GCloud for M1 Mac

Hyperledger Explorer Database Setup

I am trying to set up Hyperledger explorer using the official docs
https://github.com/hyperledger/blockchain-explorer
In the DB creation process when I run ./createdb.sh. ** I get the error Unable to Initialize policy plugin. **
Dont run with normal privilege , Try to run with sudo permissions.
chmod +x createdb.sh
sudo -u postgres ./createdb.sh

Permissions denied

I'am trying to create a package for iOS with kivy.:https://kivy.org/docs/guide/packaging-ios.html
I try to run: ./toolchain.py build kivy in terminal on mac.
Error: sudo: unable to execute ./toolchain.py: Permission denied.
My python is setup in anaconda and is running correctly.
In the first line of ./toolchain.py is: #!/anaconda/envs/python2/bin python2.7
Anyone knows how to change the permissions/how to get it to work?
When I set python to default: /usr/bin/env and adjust first line of ./toolchain.py it does execute, but in default python I'am not able to install pip.
Ensure ./toolchain.py got execution bit set (chmod a+x toolchain.py)

Getting "chmod(): Operation not permitted" on "composer update"

When I run 'composer update' I get this error:
Writing lock file
Generating autoload files
[ErrorException]
chmod(): Operation not permitted
*It works just fine with sudo, but then I have to reset the owner & permissions, Which is really annoying...
**I also tried to reset the owner of ~/.composer to www-data with 777, no effect.
***I'm using Ubuntu 16.04 LTS + Apache/2.4.18 & php7.0.26
Any idea?
chmod will only work without sudo if the owner of the file is the same as the one running the composer update command.
The problem is that the error message doesn't tell you which file it's trying to chmod.
This depends on the project.
Running the command in verbose mode will give you more details:
composer update -v
In my case, it gave me a stack trace, showing which file called chmod(), and the line number.
However, it didn't give me the path of the file passed to chmod().
I had to add a simple echo right before the call to chmod() (without forgetting to remove it afterwards).
Once you know which file/folder is responsible for the error message, change its owner with chown.
In my case (Magento 2.3), the culprit was the bin/magento file, which needs to be owned by the user running the composer commands.