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

failed build in maven docker image #34

Closed
yswtrue opened this issue Dec 4, 2023 · 8 comments · Fixed by #39
Closed

failed build in maven docker image #34

yswtrue opened this issue Dec 4, 2023 · 8 comments · Fixed by #39
Labels
bug Something isn't working Platform: Java

Comments

@yswtrue
Copy link

yswtrue commented Dec 4, 2023

Maven Version

3.9.5

Version

0.0.5

Sentry SDK Version

6.0.0

Steps to Reproduce

Dockerfile

FROM maven:3-amazoncorretto-11-debian as builder
WORKDIR /root
ADD . .
ENV SENTRY_AUTH_TOKEN="***"
RUN --mount=type=cache,target=/root/.m2 mvn clean install -Pprod -Dmaven.test.skip=true

mvn.pom

...
            <plugin>
                <groupId>io.sentry</groupId>
                <artifactId>sentry-maven-plugin</artifactId>
                <version>0.0.5</version>
                <extensions>true</extensions>
                <configuration>
                    <skip>${sentry.skip}</skip>
                    <!-- for showing output of sentry-cli -->
                    <debugSentryCli>true</debugSentryCli>

                    <org>sentry</org>

                    <project>live-backend</project>

                    <!-- in case you're self hosting, provide the URL here -->
                    <!--                    <url>https://sentry.backend-manage.com/</url>-->

                    <!-- provide your auth token via SENTRY_AUTH_TOKEN environment variable -->
                    <authToken>${env.SENTRY_AUTH_TOKEN}</authToken>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <!--
                            Generates a JVM (Java, Kotlin, etc.) source bundle and uploads your source code to Sentry.
                            This enables source context, allowing you to see your source
                            code as part of your stack traces in Sentry.
                            -->
                            <goal>uploadSourceBundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
...

Expected Result

can build success

Actual Result

...
6.331 [INFO] ----------------------< com.live:live-client-api >----------------------
6.331 [INFO] Building live-client-api 0.0.1-SNAPSHOT                            [3/4]
6.331 [INFO]   from live-client-api/pom.xml
6.331 [INFO] --------------------------------[ jar ]---------------------------------
6.336 [WARNING] Parameter 'parameters' is unknown for plugin 'maven-compiler-plugin:3.6.1:compile (default-compile)'
6.336 [WARNING] Parameter 'parameters' is unknown for plugin 'maven-compiler-plugin:3.6.1:compile (default-compile)'
6.336 [WARNING] Parameter 'parameters' is unknown for plugin 'maven-compiler-plugin:3.6.1:testCompile (default-testCompile)'
6.377 [WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
6.393 [INFO] 
6.393 [INFO] --- clean:3.2.0:clean (default-clean) @ live-client-api ---
6.400 [INFO] Deleting /root/live-client-api/target
6.405 [INFO] 
6.405 [INFO] --- apt:1.1.3:process (default) @ live-client-api ---
6.872 [INFO] 
6.872 [INFO] --- sentry:0.0.5:uploadSourceBundle (default) @ live-client-api ---
6.876 [WARNING] There's more than one source root, using /root/live-client-api/src/main/java
6.878 [INFO] Properties file not found
6.979 [INFO] Executing tasks
6.993 [INFO]      [exec] /bin/sh: 1: sentry-cli: not found
6.996 [INFO] ------------------------------------------------------------------------
6.996 [INFO] Reactor Summary for server 0.0.1-SNAPSHOT:
6.996 [INFO] 
6.996 [INFO] server ............................................. SUCCESS [  0.234 s]
6.996 [INFO] live-common ........................................ SUCCESS [  4.613 s]
6.996 [INFO] live-client-api .................................... FAILURE [  0.665 s]
6.996 [INFO] live-backend-api ................................... SKIPPED
6.996 [INFO] ------------------------------------------------------------------------
6.996 [INFO] BUILD FAILURE
6.996 [INFO] ------------------------------------------------------------------------
6.996 [INFO] Total time:  6.350 s
6.997 [INFO] Finished at: 2023-12-04T15:51:50Z
6.997 [INFO] ------------------------------------------------------------------------
6.997 [ERROR] Failed to execute goal io.sentry:sentry-maven-plugin:0.0.5:uploadSourceBundle (default) on project live-client-api: An Ant BuildException has occured: exec returned: 127
6.997 [ERROR] around Ant part ...<exec failOnError="true" executable="/bin/sh">... @ 4:51 in /root/live-client-api/target/antrun/build-main.xml
6.997 [ERROR] -> [Help 1]
6.997 [ERROR] 
6.997 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
6.997 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
6.997 [ERROR] 
6.997 [ERROR] For more information about the errors and possible solutions, please read the following articles:
6.997 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
6.997 [ERROR] 
6.997 [ERROR] After correcting the problems, you can resume the build with the command
6.997 [ERROR]   mvn <args> -rf :live-client-api
------
failed to solve: process "/bin/sh -c mvn clean install -Pprod -Dmaven.test.skip=true" did not complete successfully: exit code: 1
@yswtrue yswtrue added bug Something isn't working Platform: Java labels Dec 4, 2023
@yswtrue
Copy link
Author

yswtrue commented Dec 4, 2023

Fixed by adding configuration and download sentry-cli manual

                    <sentryCliExecutablePath>${project.basedir}/sentry-cli-Linux-x86_64</sentryCliExecutablePath>

@adinauer
Copy link
Member

adinauer commented Dec 6, 2023

Thanks for opening this issue @yswtrue. The plugin should be able to supply sentry-cli. We'll investigate and update here.

@adinauer
Copy link
Member

@yswtrue are you running the docker container on a mac with M1 chip or similar?

@yswtrue
Copy link
Author

yswtrue commented Dec 12, 2023

yes, I am building in m2 mac, but I have specific the platform: linux/amd64

@adinauer
Copy link
Member

Ah that'd explain it, running docker run maven:3-amazoncorretto-11-debian uname -m gives aarch64 which isn't included yet. We'll include it.

@yswtrue
Copy link
Author

yswtrue commented Dec 12, 2023

Thanks

@adinauer adinauer mentioned this issue Dec 13, 2023
4 tasks
@adinauer
Copy link
Member

@yswtrue we've just released 0.0.6 which should have the aarch64 version of sentry-cli allowing you to drop the <sentryCliExecutablePath> config. Feedback would be great if you decide to give it a try.

@yswtrue
Copy link
Author

yswtrue commented Dec 15, 2023

It is working well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Platform: Java
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants