Skip to content

Running dev proxy in docker - "An error occurred in a plugin" #1401

Description

@gavspeed

Help please! I followed the steps described here to run dev proxy from docker container - https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/how-to/use-dev-proxy-in-docker-container

I wish to use the mocks response feature.

I have a mocks.json and devproxyyrc.json files configured. The mocks.json is a very simple example to start with like this one - https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/technical-reference/mockresponseplugin#mocks-file-examples

Attempting to use postman (GET https://graph.microsoft.com/v1.0/me) and have configured postman to use a custom proxy pointing to 127.0.0.1:8000

The request hits the proxy but returns:

req ╭ GET https://graph.microsoft.com/v1.0/me
time │ 09/30/2025 13:47:03 +00:00
fail │ An error occurred in a plugin
pass ╰ Passed through

It may well be a mistake on my part, but any pointers you can help would be great 🙏

Activity

  1. waldekmastykarz commented on Oct 1, 2025

    @waldekmastykarz
    Collaborator

    Hey! Thanks for reaching out and sorry to hear you're running into a trouble. Could you please share with us your config file and tell us which version of Dev Proxy you're using so that we can see if we can reproduce it? Alternatively, you could also try to change the log level to trace to see if you can get more information about what might be wrong.

  2. gavspeed commented on Oct 1, 2025

    @gavspeed
    Author

    Hi !
    In the command I run, it's "ghcr.io/dotnet/dev-proxy:latest" so i'm assume that's lastest available?

    docker run command i'm using:

    docker run --rm -it `
    >>   -p 8000:8000 -p 8897:8897 `
    >>   -v "${PWD}\config:/config" `
    >>   -v "${PWD}\cert:/home/devproxy/.config/dev-proxy/rootCert" `
    >>   ghcr.io/dotnet/dev-proxy:latest --config-file /config/devproxyrc.json
    

    attaching "devproxyrc.json" and "mocks.json"

    devproxyrc.json
    mocks.json

  3. gavspeed commented on Oct 1, 2025

    @gavspeed
    Author

    with logging level set to 'trace', the following is captured:

    req ╭ GET https://graph.microsoft.com/v1.0/me
    time │ 10/01/2025 21:56:16 +00:00
    trce │ MockResponsePlugin: BeforeRequestAsync called
    trce │ MockResponsePlugin: ReplacePlaceholders called
    fail │ An error occurred in a plugin
    pass ╰ Passed through

  4. gavspeed commented on Oct 1, 2025

    @gavspeed
    Author

    req ╭ GET https://graph.microsoft.com/v1.0/me
    time │ 10/01/2025 22:01:59 +00:00
    trce │ MockResponsePlugin: BeforeRequestAsync called
    skip │ MockResponsePlugin: No matching mock response found
    trce │ MockResponsePlugin: Left BeforeRequestAsync
    pass ╰ Passed through

  5. waldekmastykarz commented on Oct 2, 2025

    @waldekmastykarz
    Collaborator

    OK, so in your mocks you have https://graph.microsoft.com/v1.0/me?* (notice the trailing ? just before the wildcard). When sending a request to https://graph.microsoft.com/v1.0/me without the question mark, it won't match your mock and should pass through, just as you're seeing. However, that doesn't explain the error. Let us investigate what's going on. Thanks again for letting us know.

  6. waldekmastykarz commented on Oct 2, 2025

    @waldekmastykarz
    Collaborator

    Unfortunately, I can't reproduce your issue. After starting the Dev Proxy container using the exact command you shared, and then calling Graph using curl -ikx http://127.0.0.1:8000 https://graph.microsoft.com/v1.0/me I'm seeing:

     req   ╭ GET https://graph.microsoft.com/v1.0/me
     time  │ 10/02/2025 06:03:12 +00:00
     skip  │ MockResponsePlugin: No matching mock response found
     pass  ╰ Passed through
    

    Can you try to run /app/devproxy/devproxy --version in your container to confirm which version you're running?

  7. locked and limited conversation to collaborators on Oct 2, 2025
  8. converted this issue into a discussion #1406 on Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions