Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables in az.conf causing error #2185

Open
6 tasks done
ChrisThibodeaux opened this issue Jun 24, 2024 · 7 comments
Open
6 tasks done

Environment variables in az.conf causing error #2185

ChrisThibodeaux opened this issue Jun 24, 2024 · 7 comments
Labels

Comments

@ChrisThibodeaux
Copy link
Contributor

About accounts on capesandbox.com

  • Issues isn't the way to ask for account activation. Ping capesandbox in Twitter with your username

This is open source and you are getting free support so be friendly!

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I did read the README!
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)
  • I have read and checked all configs (with all optional parts)

Expected Behavior

Placing an env variable as such to work: subscription_id = %(ENV:SUBSCRIPTION_ID)s

Current Behavior

Errors out with a configparser.InterpolationMissingOptionError

Failure Information (for bugs)

configparser.InterpolationMissingOptionError: Bad value substitution: option 'subscription_id' in section 'az' contains an interpolation key 'env:subscription_id' which is not a valid option name. Raw value: '%(ENV:SUBSCRIPTION_ID)s'

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Place env variable in the manner specified in the docs.

Context

Deploying in Azure while following the docs.

Question Answer
Git commit Type $ git log | head -n1 to find out
OS version Ubuntu 16.04, Windows 10, macOS 10.12.3

Failure Logs

Please include any relevant log snippets or files here.

@ChrisThibodeaux
Copy link
Contributor Author

ChrisThibodeaux commented Jun 24, 2024

cape@hostname:~$ python3 --version
Python 3.10.12
cape@hostname:~$ env | grep "SUBSCRIPTION_ID"
SUBSCRIPTION_ID=<redacted value>

The environment variable exists and is correctly set.

To view spots where the error occurs, run journalctl -u for either cape.service, cape-web.service, or cape-processor.service.

@doomedraven
Copy link
Collaborator

az worker is community based, so you need to wait till community who has AZ fixes it or you can check how to fix it

@ChrisThibodeaux
Copy link
Contributor Author

@doomedraven Thank you for the reply. I will be looking into potential fixes until someone with more knowledge comes along.

@ChrisThibodeaux
Copy link
Contributor Author

I have entered a python shell in /opt/CAPEv2 as cape user on the host machine and followed the code flow as it would execute in a running system. Oddly, it works perfectly fine. Not sure what the real issue is here.

Found a work-around until a fix is in place. I used replace, similar to the linux command sed, in my ansible to place in the Azure subscription_id, client_id, secret, and tenant. I keep those values in my ansible vault. If you are using anisble and pushing this to a repo, be sure to use no_log: true somewhere in the task.

@cccs-kevin
Copy link
Collaborator

@cccs-mog

@cccs-mog
Copy link
Contributor

cccs-mog commented Sep 11, 2024

Hi @ChrisThibodeaux, can you confirm if this is something only happening for this environment variable (namely subscription_id) you did face this for others as well ? Also could you give the full trace for the error in question ?

@ChrisThibodeaux
Copy link
Contributor Author

@cccs-mog I will try that for each env var In az.conf and report back. I'll also include the fullest trace I can for the issue.

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

No branches or pull requests

4 participants