I have mounted my Google Cloud Platform credentials file as a volume in my docker container and I use docker-compose to create the GOOGLE_APPLICATION_CREDENTIALS environment variable from this file. When I go into the docker container, the file is there and it's readable and the contents are correct, however when I inspect the content of the environment variable this is what gets returned:
docker exec -it -u celery container_name sh
/opt/ori $ $GOOGLE_APPLICATION_CREDENTIALS
/opt/ori/application_default_credentials.json: line 2: type:: not found
/opt/ori/application_default_credentials.json: line 3: project_id:: not found
/opt/ori/application_default_credentials.json: line 4: private_key_id:: not found
/opt/ori/application_default_credentials.json: line 5: private_key:: not found
/opt/ori/application_default_credentials.json: line 6: client_email:: not found
/opt/ori/application_default_credentials.json: line 7: client_id:: not found
/opt/ori/application_default_credentials.json: line 8: auth_uri:: not found
/opt/ori/application_default_credentials.json: line 9: token_uri:: not found
/opt/ori/application_default_credentials.json: line 10: auth_provider_x509_cert_url:: not found
/opt/ori/application_default_credentials.json: line 11: client_x509_cert_url:: not found
Obviously it's partially reading the JSON file because it extracts the keys, but why can't it find the values?
This statement /opt/ori $ $GOOGLE_APPLICATION_CREDENTIALS is treating the credentials file as an executable and trying to execute it as a script.
This line /opt/ori/application_default_credentials.json: line 2: type:: not found shows you that the operating system could not find the program type:: to execute.
Related
I have an aws lambda in python 3.9 with a build number in it that I'm regularly updating from ci with the following code:
zip zip -g lambda_function.zip lambda_function.py
aws lambda update-function-code --function-name ... --zip-file lambda_function.zip
This never errors or anything, and seems to work. However >50% of the time, when I try to call the lambda immediately afterwards - I just get "Internal server error"... and if I look at what's gone wrong in the back, I see:
"errorMessage": "[Errno 13] Permission denied: '/var/task/lambda_function.py'",
"errorType": "PermissionError",
"requestId": "",
"stackTrace": [
" File \"/var/lang/lib/python3.9/importlib/__init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n",
" File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n",
" File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n",
" File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n",
" File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n",
" File \"<frozen importlib._bootstrap_external>\", line 846, in exec_module\n",
" File \"<frozen importlib._bootstrap_external>\", line 982, in get_code\n",
" File \"<frozen importlib._bootstrap_external>\", line 1039, in get_data\n"
]
}
Then, after a certain amount of time it seems to start working again but with the last working version - the version I tried to promote just seemed to vanish into thin air. the weird thing, is, some of the time it works. I googled that error and found people talking about permissions of the file inside the zip - so added this code:
chmod 644 $(find . -type f)
chmod 755 $(find . -type d)
before zipping. Which achieved absolutely nothing.
It really feels like a race condition of some sort on the update... something like use of the lambda while trying to update it breaks it or something like that - but I don't know what to do next or how to fix it. Any ideas would be greatly appreciated.
I've came across the same issue and fixed somewhat drastically by changing permission of the application and requirements packages.
/home/app contains my lambda modules and requirements.txt.
Inside that directory I've run:
RUN pip install -r requirements.txt -t .
after I've run:
RUN chmod -R 755 /home/app
and it worked.
The one you applied to the zip seems the refined version and for what I've experienced I would try to apply it to requirements packages.
I tried installing Apache Atlas on a single EC2 node but if fails to start:
wget http://www-eu.apache.org/dist/atlas/1.0.0/apache-atlas-1.0.0-sources.tar.gz
tar xvfz apache-atlas-1.0.0-sources.tar.gz
cd apache-atlas-sources-1.0.0/
export MAVEN_OPTS="-Xms2g -Xmx2g"
mvn clean -DskipTests package -Pdist,embedded-hbase-solr
python atlas_start.py
/tmp/apache-atlas-sources-1.0.0/distro/src/conf/atlas-env.sh: line 59: MANAGE_LOCAL_HBASE=${hbase.embedded}: bad substitution
/tmp/apache-atlas-sources-1.0.0/distro/src/conf/atlas-env.sh: line 62: MANAGE_LOCAL_SOLR=${solr.embedded}: bad substitution
/tmp/apache-atlas-sources-1.0.0/distro/src/conf/atlas-env.sh: line 65: MANAGE_EMBEDDED_CASSANDRA=${cassandra.embedded}: bad substitution
/tmp/apache-atlas-sources-1.0.0/distro/src/conf/atlas-env.sh: line 68: MANAGE_LOCAL_ELASTICSEARCH=${elasticsearch.managed}: bad substitution
Exception: [Errno 2] No such file or directory
Traceback (most recent call last):
File "atlas_start.py", line 163, in <module>
returncode = main()
File "atlas_start.py", line 73, in main
mc.expandWebApp(atlas_home)
File "/tmp/apache-atlas-sources-1.0.0/distro/src/bin/atlas_config.py", line 160, in expandWebApp
jar(atlasWarPath)
File "/tmp/apache-atlas-sources-1.0.0/distro/src/bin/atlas_config.py", line 213, in jar
process = runProcess(commandline)
File "/tmp/apache-atlas-sources-1.0.0/distro/src/bin/atlas_config.py", line 249, in runProcess
p = subprocess.Popen(commandline, stdout=stdoutFile, stderr=stderrFile, shell=shell)
File "/usr/lib64/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1025, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
How to install Apache Atlas on one AWS EC2?
Thanks.
I agree you should check the script. However, the notes are not very clear. You need to have configured it too. That means defining if you are using a pre-built ZK installation or not, but more importantly, Atlas by default uses HBase as its store. You MUST have HDFS available too, and change the config to point to HDFS Namenode (usually on port 9000).
Hope this helps.
Please check if JAVA_HOME initialized or has correct value. Initializing with the valid value solved the issue for me.
Google Cloud SDK installation process is failing on my machine(MAC) and giving me following stack trace.
Traceback (most recent call last):
File "/Users/ttn/Desktop/google-cloud-sdk/bin/bootstrapping/install.py", line 218, in <module>
main()
File "/Users/ttn/Desktop/google-cloud-sdk/bin/bootstrapping/install.py", line 203, in main
sdk_root=bootstrapping.SDK_ROOT,
File "/Users/ttn/Desktop/google-cloud-sdk/lib/googlecloudsdk/core/platforms_install.py", line 452, in UpdateRC
completion_update, path_update, rc_path, sdk_root, host_os).Update()
File "/Users/ttn/Desktop/google-cloud-sdk/lib/googlecloudsdk/core/platforms_install.py", line 214, in Update
self.path, rc_contents, source_line=self._GetSourceLine())
File "/Users/ttn/Desktop/google-cloud-sdk/lib/googlecloudsdk/core/platforms_install.py", line 167, in _GetRcContents
filtered_contents=filtered_contents, line=line)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 197: ordinal not in range(128)
Here are few more details:
System's default python version
python -V
Python 3.6.1 :: Anaconda custom (x86_64)
Python version for Cloud SDK.
echo $CLOUDSDK_PYTHON
/usr/bin/python2.7
Checking gcloud command
gcloud
-bash: gcloud: command not found
Note: This question might seem as duplicate, but i tried few solution available on portal but nothing worked for me.
There is an open pull request to address this issue linked below that fixes the issue. The issue was that one of the files contain non-ASCII characters which causes the the Google Cloud SDK installer to fail. The open() function in Python 2.7 doesn't allow for a specified encoding.
Fix:
All references with open() should be replaced with io.open(..., encoding='utf-8'). Once again check the pull request to see those changes.
Resources:
- https://github.com/google-cloud-sdk/google-cloud-sdk/pull/2/files
I'm getting some very unusual behaviour.
I followed these instructions for installing jetty but used the latest version instead (9.1.1v20140108)
I had reason to restart Jetty and found I was getting these errors (logged in as root)
Starting Jetty: FAILED Wed Feb 5 12:35:59 EST 2014
So I spent 30 mins looking for an answer, then for reasons I can't recall, I did service jetty check and it was running (had a pid).
So I tried again with service Jetty stop:
root#erp:/var/log# service jetty stop
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Stopping Jetty: start-stop-daemon: warning: failed to kill 7817: No such process
1 pids were not killed
No process in pidfile '/var/run/jetty.pid' found running; none killed.
OK
None killed? Ok. Let's check that:
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
START_INI = /srv/jetty/start.ini
JETTY_HOME = /srv/jetty
JETTY_BASE = /srv/jetty
JETTY_CONF = /srv/jetty/etc/jetty.conf
JETTY_PID = /var/run/jetty.pid
JETTY_START = /srv/jetty/start.jar
JETTY_LOGS = /srv/jetty/logs
CLASSPATH =
JAVA = /usr/bin/java
JAVA_OPTIONS = -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp
JETTY_ARGS = jetty.port=8085 jetty-logging.xml jetty-started.xml
RUN_CMD = /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 jetty-logging.xml jetty-started.xml
No PID? Let's check that:
root#erp:/var/log# service jetty start
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Starting Jetty: FAILED Wed Feb 5 12:39:43 EST 2014
Ok, is there a PID?
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
[edit]
Jetty running pid=7993
Weird. Sure enough, a stop and check will give the same results.
What's going on with the jetty startup script? And why am I getting FAILED errors on start which are incorrect, and fail to remove pid errors on stop which are also incorrect?
I have got a fix for all those who have been using that tutorial to install jetty
nano /etc/init.d/jetty
And change this syntax :
start-log-file="$JETTY_LOGS/start.log"
to
start-log-file="start.log"
It will fix everything in the latest jetty build and make it run like a charm.
Hope I could be of help
Ok, so this was a tricky one that was the result of a recent Java update.
I jumped into the jetty.sh at /etc/init.d/jetty and grabbed out the actually executed line:
$ /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state \
-Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty \
-Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 \
jetty-logging.xml jetty-started.xml
and I got this:
java.io.IOException: Cannot read file: modules/npn/npn-1.7.0_51.mod
at org.eclipse.jetty.start.Modules.registerModule(Modules.java:405)
at org.eclipse.jetty.start.Modules.registerAll(Modules.java:395)
at org.eclipse.jetty.start.Main.processCommandLine(Main.java:561)
at org.eclipse.jetty.start.Main.main(Main.java:102)
Which in turn lead me to this solution on the eclipse dev list:
$ cp /srv/jetty/modules/npn/npn-1.7.0_45.mod /srv/jetty/modules/npn/npn-1.7.0_51.mod
$ chown jetty:jetty /srv/jetty/modules/npn/npn-1.7.0_51.mod
Sure enough, Jetty restarted without hassle.
Try running below command in terminal.
sudo service jetty9 stop
I run Jetty 9.2.10.v201503 on pcDuino v3, Ubuntu 14.04. According to my experience with this relatively slow platform, this message may be reported when Jetty server itself starts longer than internal waiting loop in /etc/init.d/jetty script expects.
After adding “set –x” at the beginning of /etc/init.d/jetty file and running that script I noticed that internal waiting loop is implemented as “for” making 15 steps and periodically checking content of the $JETTY_BASE/jetty.state file.
After waiting additional couple of seconds, Jetty server is up and running ok, no errors/warrnings in log files.
I need to build GLEW from source so I can use it with Mingw in Code::Blocks being Mingw doesn't like to use the one's they compile in VS. I'm using Cygwin and I download the source for GLEW here and unzip it. I then browse to the folder with Cygwin using cd. Then I run
make Makefile
It then gives me these errors.
config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: ` case $1 in
config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: ` case $1 in
Makefile:40: *** "Platform '' not supported". Stop.
I've read around and I haven't been able to find much useful on solving this problem yet. If you know a better way I can get GLEW working with Mingw that would also answer my question.
On Windows XP
Using Code::Blocks 10.05
Using Cygwin 1.7.16-1
Using GLEW 1.8.0
UPDATE
Those errors have been fixed using dos2unix on the config.guess file. However, when I run the Makefile now it says there is nothing to be done for it.
Looks very much like config.guess has DOS line endings ("\r\n") but make is expecting Unix line endings ("\n"). I would just run whatever tool on config.guess to convert it to Unix line endings, my cygwin has a tool called dos2unix that will do the trick.
If you just want to code and build under Windows refer to this topic Using GLEW to use OpenGL extensions under Windows
Sorry for the late reply on this, but setting a variable SYSTEM works in cygwin:
$ SYSTEM=cygwin make