-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
3.8.3 and Electron JDBC Security error - SRCFG00027: Could not find a mapping #40065
Comments
/cc @sberyozkin (security) |
@tmulle Can you provide more information please, ideally a simple reproducer, sounds like a configuration mapping problem, also CC @radcortez |
I tried to reproduce it with no luck. Maybe it requires some specific setup. Can you please provider a reproducer? Thank you! |
Hi, I will try but the project is using We're also using I will have to see if I can make a small reproducer, the problem is I have no idea WHERE it's breaking. I've tried commenting out the quarkus FORM/BASIC auth properties, and that still fails. I've tried commenting out I even tried updating all the dependencies to their latest versions and still the same error. I am posting my All I know is that Quarkus 3.6.7 works fine and then 3.7+ is when things break. No code has changed, I just bumped the version of quarkus. Changing JUST the quarkus version back to These are my application.properties for just the security/jdbc configs. There was nothing else in there except our own application properties. I don't have any custom security code, I use the standard But to me, the error I'm getting looks like it is a Thanks..
This is my pom.xml <?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.acme</groupId>
<artifactId>quarkus-ebean-supportsite</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.13.0</compiler-plugin.version>
<ebean.migration.version>14.0.0</ebean.migration.version>
<ebean.version>15.1.0</ebean.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<omnifaces-quarkus.version>4.3.0</omnifaces-quarkus.version>
<primefaces-quarkus.version>3.13.5</primefaces-quarkus.version>
<myfaces.version>4.0.1</myfaces.version>
<quarkus.version>3.9.3</quarkus.version>
<poi.version>5.2.2</poi.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<lombok.version>1.18.32</lombok.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<!-- Faces -->
<dependency>
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
<artifactId>myfaces-quarkus</artifactId>
<version>${myfaces.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.primefaces</groupId>
<artifactId>quarkus-primefaces</artifactId>
<version>${primefaces-quarkus.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.primefaces</groupId>
<artifactId>quarkus-primefaces-extensions</artifactId>
<version>${primefaces-quarkus.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.omnifaces</groupId>
<artifactId>quarkus-omnifaces</artifactId>
<version>${omnifaces-quarkus.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.quarkus</groupId>-->
<!-- <artifactId>quarkus-arc</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.quarkus</groupId>-->
<!-- <artifactId>quarkus-smallrye-openapi</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mariadb</artifactId>
<version>${ebean.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.ebean</groupId>-->
<!-- <artifactId>ebean-postgres</artifactId>-->
<!-- <version>${ebean.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- <version>42.3.3</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.6.0</version>
</dependency>
<!-- <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
</dependency>-->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean.migration.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>${ebean.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.w3c.css</groupId>
<artifactId>sac</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.cssparser</groupId>
<artifactId>cssparser</artifactId>
<version>0.9.17</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.converter</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.document</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-jdbc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-mariadb</artifactId>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-youtube</artifactId>
<version>v3-rev222-1.25.0</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.36</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:${ebean.version}</tile>
</tiles>
</configuration>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<!-- additional annotation processor required as of Lombok 1.18.16 -->
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>0.2.0</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<skipITs>false</skipITs>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project> |
Can you check which url check is triggering the exception and where it is being executed? I suspect that something is happening during static init, where this specific configuration is not yet available. |
So, I found the issue, but not sure why 3.6.7 allowed it to work and not 3.7+. Turns out they have They are using Ebean's They had defined utility methods on their entities like this: @Entity
public class FailedLogin extends Model {
@Id
@GeneratedValue
public long id;
@Column(nullable = false)
public String userEmail;
@Column(nullable = false)
public String ipAddr;
@Column(nullable = false)
public Date attempted;
public String reason;
@Transient
private static final SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
public FailedLogin(String userEmail, String ipAddr, Date attempted, String reason) {
super();
this.userEmail = userEmail;
this.ipAddr = ipAddr;
this.attempted = attempted;
this.reason = reason;
}
public static Finder<Long, FailedLogin> find = new Finder<Long, FailedLogin>(FailedLogin.class);
// count failed
public static int countAllFailed(int minutes) {
long t = System.currentTimeMillis() - (minutes * 60 * 1000);
return find.query().where().gt("attempted", new Date(t)).findCount();
}
/**
* Return all failed user logins
*
* @return JSON with id, email, loginDate, ipAddr, org, ogrCat
*/
@RolesAllowed({"webadmin", "development", "support"})
public static JsonObject getAllAsJson() {
String sql = "SELECT ul.id, ul.user_email, ul.ip_addr, ul.attempted, u.state_code, u.country_code, o.org_name, o.org_cat from user_login ul LEFT OUTER JOIN user u ON ul.user_email = u.user_email LEFT OUTER JOIN org o ON u.org_org_id = o.org_id";
List<FailedLogin> all = find.all();
JsonObject result = new JsonObject();
JsonArray an = new JsonArray();
result.put("data", an);
for (FailedLogin f : all) {
an.add(f.toJson());
}
return result;
}
} I went through an commented out every So, question is: The For reference here is the stack trace with the
This is the line in that stacktrace:
|
Wondering if we need to do the same thing as #40327 in here with //cc @sberyozkin @michalvavrik |
We have many tests for RolesAllowed on CDI beans and the This comment #40065 (comment) shows a My suggestion is that I need to find out when static intercepted methods are initialized and create a reproducer because we can't say it is wrong ATM. We need more info. |
@tmulle thank you for reporting this, do you think it would be feasible to create a simple reproducer? if not, I'll have a look anyway eventually, but it would quicken things (as time as limited....) |
Never mind @tmulle , the issue is in static secured methods. It's easy to reproduce it. I'll have a look. |
Static interceptors are initialized during static init: Line 247 in 8790966
And all beans are singletons, hence the issue. We can initialize the events helper lazily I guess. |
#40457 takes care of it. @radcortez I didn't find a way to recognize that runtime config / configmapping is ready without listening to |
What about a recorder method called during runtime init? |
That will work, but it require either to initialize bean sooner than required or new static env variable. I just thought it would be nice to find out dynamically, but it is not required. You are right I have options. |
The issue is that SR Config does not know about static/runtime. We first register the static init config with If getting to a point where the mapping is not available, it means that you are in the static phase, and there is nothing you can do to recover from it unless it is acceptable to read configuration values in static init. |
Describe the bug
Trying to update a project which uses 3.6.7 of quarkus to 3.8.3 and even 3.9.3 that uses the
electron-jdbc-security
extension and getting the error below when trying to start the application.The program compiles just fine, it just fails starting up.
I also tried
3.7.0
and that fails..Reverting back to
3.6.7
works, but just wondering if this is a bug or a migration step I need to do? I didn't find anything about this error or any migration steps with security in the change logs.The text was updated successfully, but these errors were encountered: