Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Error: "GOOGLE_APPLICATION_CREDENTIALS" environment variable must be set to path of the file containing service account json key #29

Open
herbiel opened this issue May 11, 2020 · 2 comments

Comments

@herbiel
Copy link

herbiel commented May 11, 2020

i have set environment on system,run export GOOGLE_APPLICATION_CREDENTIALS="/tmp/gcs_service_account_key.json"
and create config file like this
cat /usr/local/freeswitch/conf/autoload_configs/google_tts.xml




but if i load the mod_google_tts, it also tell me Error: "GOOGLE_APPLICATION_CREDENTIALS" environment variable must be set to path of the file containing service account json key

and this gcs_service_account_key.json is right,so can you help me ?

@davehorton
Copy link
Collaborator

That log means that the environment variable has not been set -- at least not for the freeswitch process.

The best place to set the environment variable -- where I set it -- is in the systemd config file that manages freeswitch:

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target

[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
EnvironmentFile=-/etc/default/freeswitch
Environment="LD_LIBRARY_PATH=/usr/local/lib"
Environment="GOOGLE_APPLICATION_CREDENTIALS=/home/admin/credentials/gcp.json"
ExecStart=/usr/local/freeswitch/bin/freeswitch -nc -nonat

@herbiel
Copy link
Author

herbiel commented May 12, 2020

That log means that the environment variable has not been set -- at least not for the freeswitch process.

The best place to set the environment variable -- where I set it -- is in the systemd config file that manages freeswitch:

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target

[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
EnvironmentFile=-/etc/default/freeswitch
Environment="LD_LIBRARY_PATH=/usr/local/lib"
Environment="GOOGLE_APPLICATION_CREDENTIALS=/home/admin/credentials/gcp.json"
ExecStart=/usr/local/freeswitch/bin/freeswitch -nc -nonat

Thanks for your help .it work on my freeswitch too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants