andyli86 opened a new issue, #8404: URL: https://github.com/apache/incubator-devlake/issues/8404
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues. ### What happened I am writing a plugin for devlake to do some customized metrics calculation, I begin by writing a minimal plugin, I write PluginEntry in plugin.go and PluginMeta etc in impl/impl.go, and the plugin can success compile and generate .so file, after I make a image with official devlake and copy .so under /app/bin/plugins, devlake will try to load it during the startup, but it always show "plugin already loaded" error message like: ``` devlake-1 | panic: attached stack trace devlake-1 | -- stack trace: devlake-1 | | github.com/apache/incubator-devlake/core/runner.LoadGoPlugins devlake-1 | | /app/core/runner/loader.go:88 devlake-1 | | github.com/apache/incubator-devlake/core/runner.LoadPlugins devlake-1 | | /app/core/runner/loader.go:38 devlake-1 | | github.com/apache/incubator-devlake/server/services.Init devlake-1 | | /app/server/services/init.go:123 devlake-1 | | github.com/apache/incubator-devlake/server/api.Init devlake-1 | | /app/server/api/api.go:58 devlake-1 | | github.com/apache/incubator-devlake/server/api.CreateAndRunApiServer devlake-1 | | /app/server/api/api.go:79 devlake-1 | | main.main devlake-1 | | /app/server/main.go:33 devlake-1 | | runtime.main devlake-1 | | /usr/local/go/src/runtime/proc.go:250 devlake-1 | | runtime.goexit devlake-1 | | /usr/local/go/src/runtime/asm_amd64.s:1598 devlake-1 | Wraps: (2) plugin.Open("bin/plugins/minimal_plugin/minimal_plugin"): plugin already loaded devlake-1 | Wraps: (3) plugin.Open("bin/plugins/minimal_plugin/minimal_plugin"): plugin already loaded devlake-1 | Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *errors.errorString ``` I check my container there is only one minimal_plugin.so in the container, but I don't know why the devlake plugin framework say it already loaded, from the github.com/apache/incubator-devlake/core/runner.LoadGoPlugins code it is pretty straight forward just look all the folder and find each .so file then load each one... so I really confused. ### What do you expect to happen the plugin can be loaded successfully ### How to reproduce Here is what I did: I put my plugin code in a separate repo, build it to a .so file, then use a Dockerfile to copy this .so file to /app/bin/plugins and build a new image, then use the default docker-compose-dev.yaml in devlake repo to launch this image ``` FROM golang:1.24 AS builder COPY . /app WORKDIR /app RUN go mod tidy RUN go build -buildmode=plugin -o /app/bin/plugins/minimal_plugin.so plugin.go # Use the official DevLake image as base FROM devlake.docker.scarf.sh/apache/devlake:latest AS devlake # Switch to root to handle permissions USER root # Remove all existing plugins to ensure a clean slate # This helps rule out conflicts with *any* built-in plugin #RUN rm -rf /app/bin/plugins/* # Ensure the directory exists and has correct permissions too (belt and suspenders) RUN mkdir -p /app/bin/plugins/minimal_plugin && chmod -R 755 /app/bin/plugins/minimal_plugin # Copy ONLY the minimal plugin COPY --from=builder /app/bin/plugins/minimal_plugin.so /app/bin/plugins/minimal_plugin/minimal_plugin.so # Switch back to devlake user USER devlake ``` build this docker image as devlake-minimal-test and update the docker compose yml code like below: ``` ...... devlake: image: devlake-minimal-test:latest ports: - 8080:8080 restart: always volumes: - devlake-log:/app/logs env_file: - ./.env environment: LOGGING_DIR: /app/logs TZ: UTC depends_on: - mysql ...... ``` ### Anything else _No response_ ### Version v1.0.1 ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@devlake.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org