question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong Property Expressions evaluation

See original GitHub issue

Describe the bug When an application.properties has an expression with the character {, Quarkus evaluates the expression wrong.

Expected behavior If I have the property:

key = ${TOKEN:111111{11}

Using the annotation @ConfigProperty(name = "key"), I would expect to get the value:

  • key: 111111{11

Actual behavior The problem is, the configuration doesn’t understand the chart { in the middle of an expression, and it doesn’t close the expression correctly. The result of the previous case is: key: 111111{11} -> This includes the curly brace that closes the expression }.

I tried to scape the curly brace in the expression:

key = ${TOKEN:111111\{11}

But, I got the same result: 111111{11}. The walkaround that I found is not to close the expression:

key = ${TOKEN:111111{11

That looks wrong to me.

To Reproduce Steps to reproduce the behavior:

  1. Add an expression in the application.properties file with a curly brace key=${SOMETHING:0000{0000}

Configuration

key=${SOMETHING:0000{0000}

Environment (please complete the following information):

  • Output of uname -a or ver:
Darwin WALT952837.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
  • Output of java -version:
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: I tested on Quarkus 1.5.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):
------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.1 (Oracle Corporation 11.0.1+13)
OS:           Mac OS X 10.14 x86_64

Thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
provcristianmaluendacommented, Jul 7, 2020

IMHO we should provide a way to escape it, since generated passwords may contain braces, so asking the developer to perform changes in the code to support that looks weird to me 😃

This is my case. I had an API key with braces. My walkaround was adding a key with the token and use it in the expression key=${TOKEN:${token}}

1reaction
gastaldicommented, Jul 7, 2020

IMHO we should provide a way to escape it, since generated passwords may contain braces, so asking the developer to perform changes in the code to support that looks weird to me 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple Mistake to Avoid when Evaluating an Expression
When Students go to evaluate a basic expression they often make a simple mistake that is very obvious and easy to miss.
Read more >
Using Distributive Property to Evaluate Expressions - YouTube
Using Distributive Property to Evaluate Expressions. Watch later ... An error occurred while retrieving sharing information.
Read more >
Evaluating Expressions Error Analysis Teaching Resources
This resource provides students an opportunity to practice evaluating algebraic expressions that have already been done incorrectly.
Read more >
Expression evaluation error in rule Invalid index
Expression evaluation error in rule Invalid index: Cannot index property 'EXTERNAL_PROTECTION_TYPE' of type Text into type EWR_EPMPARFPipeline?list^2.
Read more >
Error while trying to evaluate an expression
I got a collection of objects with one of the properties of the object as a type of another class. I am passing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found