TheMisinformationGame / MisinformationGame

The Misinformation Game is a social-media simulator built to study how people interact with information on social-media.
https://misinfogame.com
Creative Commons Attribution 4.0 International
24 stars 5 forks source link

Problems with installing Google Cloud SDK #15

Closed rameliaz closed 1 year ago

rameliaz commented 1 year ago

When I was executing deploy.sh I encountered a problem with Google Cloud SDK installation. Below is the warning message:

.GoogleCloud/google-cloud-sdk/install.sh
Welcome to the Google Cloud CLI!
.GoogleCloud/google-cloud-sdk/install.sh: line 32: /c/Users/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
.GoogleCloud/google-cloud-sdk/install.sh: line 32: /c/Users/AppData/Local/Microsoft/WindowsApps/python: Permission denied
.GoogleCloud/google-cloud-sdk/install.sh: line 200: /c/Users/AppData/Local/Microsoft/WindowsApps/python: Permission denied
Unable to install Google Cloud!

After that, the installation process abruptly ended.

Then I tried to install Google Cloud SDK using an installer, it worked perfectly. So I wonder what's the solution for this?

Sothatsit commented 1 year ago

When I was executing deploy.sh I encountered a problem with Google Cloud SDK installation. Below is the warning message:

.GoogleCloud/google-cloud-sdk/install.sh
Welcome to the Google Cloud CLI!
.GoogleCloud/google-cloud-sdk/install.sh: line 32: /c/Users/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
.GoogleCloud/google-cloud-sdk/install.sh: line 32: /c/Users/AppData/Local/Microsoft/WindowsApps/python: Permission denied
.GoogleCloud/google-cloud-sdk/install.sh: line 200: /c/Users/AppData/Local/Microsoft/WindowsApps/python: Permission denied
Unable to install Google Cloud!

After that, the installation process abruptly ended.

Then I tried to install Google Cloud SDK using an installer, it worked perfectly. So I wonder what's the solution for this?

Hi @rameliaz, I'm sorry to see that you've run into problems! It appears that your current installation of Python3 cannot be accessed during installation (i.e., it can't run /c/Users/AppData/Local/Microsoft/WindowsApps/python3). This can be caused if your user account doesn't have permission to run python3, or it could be caused by other security managers on your computer.

The Google Cloud SDK installer may include its own installation of Python to avoid these types of issues. Ironically, this is also the reason that we install our own installation of Google Cloud SDK.

I can see a couple of options that may help you to run the deployment script:

1) Change the permissions of the program /c/Users/AppData/Local/Microsoft/WindowsApps/python3 to allow you to run it. This is quite specific to your own computer, so I'm afraid I can't give too much help with this. However, you may be able to find some help on Google (e.g., https://stackoverflow.com/questions/56974927/permission-denied-trying-to-run-python-on-windows-10). Hopefully, that will solve the issue.

2) I will add a command-line option for deploy.sh to skip the installation of Google Cloud SDK, and to use your local installation instead. This can cause other issues, so I won't make it the default, but it may work in your case. However, I'm not sure when I'll get around to this.

Sothatsit commented 1 year ago

If anyone in the future is curious about reproducing this bug, you can point the CLOUDSDK_PYTHON environment variable to a missing installation to get a similar error.

> CLOUDSDK_PYTHON=/missing-python3 ./deploy.sh

.GoogleCloud/google-cloud-sdk/install.sh
Welcome to the Google Cloud CLI!
.GoogleCloud/google-cloud-sdk/install.sh: line 200: /missing-python3: No such file or directory
Unable to install Google Cloud!
rameliaz commented 1 year ago

Hi Padraig,

Thanks so much for looking into this!

I'm trying to reinstall python and ran npm config set python c:/users/pathto/Python 3.11 just in case. I double-checked to make sure that my workable version of python was on the path. But then I got another error (below), and it seems that it fails to rebuild node-gyp.

the log is here.

Is this somewhat related to my previous problem (or no)?

node@19.4.0 preinstall D:\MisinformationGame\node_modules\node node installArchSpecificPackage

  • node-win-x64@19.4.0 added 1 package in 7.909s found 0 vulnerabilities

protobufjs@6.11.3 postinstall D:\MisinformationGame\node_modules\protobufjs node scripts/postinstall

protobufjs@7.1.2 postinstall D:\MisinformationGame\node_modules\@grpc\grpc-js\node_modules\protobufjs node scripts/postinstall

metrohash@2.8.0 install D:\MisinformationGame\node_modules\metrohash node-gyp rebuild

D:\MisinformationGame\node_modules\metrohash>if not defined npm_config_node_gyp (node "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#' gyp ERR! stack at createConfigFile (C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:118:21) gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:77:11) gyp ERR! System Windows_NT 10.0.19045 gyp ERR! command "D:\MisinformationGame\node_modules\node\bin\node.exe" "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\MisinformationGame\node_modules\metrohash gyp ERR! node -v v19.4.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! This is a bug in node-gyp. gyp ERR! Try to update node-gyp and file an Issue if it does not help: gyp ERR! https://github.com/nodejs/node-gyp/issues npm ERR! code ELIFECYCLE npm ERR! errno 7 npm ERR! metrohash@2.8.0 install: node-gyp rebuild npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the metrohash@2.8.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\AppData\Roaming\npm-cache_logs\2023-02-21T21_18_31_275Z-debug.log Installing dependencies failed!

Sothatsit commented 1 year ago

Hi Padraig,

Thanks so much for looking into this!

I'm trying to reinstall python and ran npm config set python c:/users/pathto/Python 3.11 just in case. I double-checked to make sure that my workable version of python was on the path. But then I got another error (below), and it seems that it fails to rebuild node-gyp.

the log is here.

Is this somewhat related to my previous problem (or no)?

node@19.4.0 preinstall D:\MisinformationGame\node_modules\node node installArchSpecificPackage

  • node-win-x64@19.4.0 added 1 package in 7.909s found 0 vulnerabilities

protobufjs@6.11.3 postinstall D:\MisinformationGame\node_modules\protobufjs node scripts/postinstall

protobufjs@7.1.2 postinstall D:\MisinformationGame\node_modules@grpc\grpc-js\node_modules\protobufjs node scripts/postinstall

metrohash@2.8.0 install D:\MisinformationGame\node_modules\metrohash node-gyp rebuild

D:\MisinformationGame\node_modules\metrohash>if not defined npm_config_node_gyp (node "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#' gyp ERR! stack at createConfigFile (C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:118:21) gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:77:11) gyp ERR! System Windows_NT 10.0.19045 gyp ERR! command "D:\MisinformationGame\node_modules\node\bin\node.exe" "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\MisinformationGame\node_modules\metrohash gyp ERR! node -v v19.4.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! This is a bug in node-gyp. gyp ERR! Try to update node-gyp and file an Issue if it does not help: gyp ERR! https://github.com/nodejs/node-gyp/issues npm ERR! code ELIFECYCLE npm ERR! errno 7 npm ERR! metrohash@2.8.0 install: node-gyp rebuild npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the metrohash@2.8.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\AppData\Roaming\npm-cache_logs\2023-02-21T21_18_31_275Z-debug.log Installing dependencies failed!

Hi @rameliaz,

It looks like you are having issues with the installation of dependencies. I'm not sure why this would fail, sorry. I don't have any experience with node-gyp.

However, I have recently updated the deployment script to skip the installation of the Google Cloud SDK if you already have it installed. Hopefully, this should fix your initial issue.

This works by first checking if the gcloud and gsutil commands are available in your command-line. If they are, then it will use those instead of trying to install the Google Cloud SDK itself.

I hope this helps! Let me know if you run into any more issues.

Sothatsit commented 1 year ago

Hi @rameliaz,

I have also now removed some dependencies that could have been causing some issues with the installation. I hope this helps.

Thanks, ~ Paddy

Sothatsit commented 1 year ago

I am closing this issue due to inactivity