Promtail: no files matched requested path, nothing will be tailed

promtail’s onfig:

server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

client:
url: http://127.0.0.1:3100/api/prom/push

scrape_configs:
    - job_name: system
      static_configs:
          - targets:
                - localhost
            labels:
                job: web_app
                __path__: D:/Projects/.../logs/web_app.log

promtail’s log

level=debug ts=2021-01-13T03:55:25.772773Z caller=filetargetmanager.go:207 msg="new target" labels="{__address__=\"localhost\"}"
level=info ts=2021-01-13T03:55:25.7729264Z caller=filetargetmanager.go:261 msg="Adding target" key="{job=\"web_app\"}"
level=debug ts=2021-01-13T03:49:56.301695Z caller=filetarget.go:216 msg="no files matched requested path, nothing will be tailed" path=D
:/Projects/.../logs/web_app.log

Folder with file and logs are present.
Loki is working as docker container and ports are mapped to the host
(I changed slashes in the other direction - the result is the same)

The same is on Mac with absolute path

Where is the problem?

Hi,

You are missing quotation in your path, folloz this example :

Good Luck

I also have tried with quotas - result is the same :frowning:

server:
    http_listen_port: 9080
    grpc_listen_port: 0
    log_level: debug

positions:
    filename: /tmp/positions.yaml

client:
    url: http://loki:3100/api/prom/push

scrape_configs:
    - job_name: system
      static_configs:
          - targets:
                - localhost
            labels:
                job: web_app
                __path__: "/Users/logs/web_app.log"

log:

level=debug ts=2021-01-13T20:02:17.6817765Z caller=manager.go:195 component=discovery msg="Starting provider" provider=static/0 subs=[system]
level=debug ts=2021-01-13T20:02:17.6823934Z caller=manager.go:213 component=discovery msg="Discoverer channel closed" provider=static/0
level=info ts=2021-01-13T20:02:17.6827801Z caller=server.go:229 http=[::]:9080 grpc=[::]:32839 msg="server listening on addresses"
level=info ts=2021-01-13T20:02:17.6830333Z caller=main.go:110 msg="Starting Promtail" version="(version=master-322e4bc, branch=master, revision=322e4bc6)"
level=debug ts=2021-01-13T20:02:22.6822308Z caller=filetargetmanager.go:207 msg="new target" labels="{__address__=\"localhost\"}"
level=info ts=2021-01-13T20:02:22.6824594Z caller=filetargetmanager.go:261 msg="Adding target" key="{job=\"web_app\"}"
level=debug ts=2021-01-13T20:02:22.6825629Z caller=filetarget.go:216 msg="no files matched requested path, nothing will be tailed" path=/Users/logs/web_app.log

Hi,

Just to make sure, could you create a job like this :

   - job_name: grafana

static_configs:

  • targets:
    • grafana
      labels:
      job: grafana
      path: “C:/Program Files/GrafanaLabs/grafana/data/log/web_app.log”

And copy your web app log there and see if it get parsed.

Good Luck

level=debug ts=2021-01-14T07:32:45.5506598Z caller=filetarget.go:216 msg="no files matched requested path, nothing will be tailed" path="C:/Program 
Files/GrafanaLabs/grafana/data/log/grafana.log"

Hi,

Could you also change the position file location

Good Luck

Change file location in docker, am I right?
If so - it does not take an effect - promtail still not found log
(the same is on Windows)

Hi,

Did you follow the steps in this page to troubleshoot:

Also i see that your system language is russian, it can cause issues.

Good Luck

I use Windows with Russian locale and MacBook - the problem is on both OS

Troubleshooting Promtail is not useful - I use promtail as docker container, but this section describes the flags for running the program in the CLI not in docker. it describes the problems of processing logs and not the problem of discovering them

Thanks @wlargou for all your suggestions here!!

@budarin you mention you are running docker containers on both Mac and Windows, in both of these environments Docker runs in a virtual machine so you would have to mount the paths on the local filesystem into the container as a volume to be able to access any files. I’m wondering if this is the issue you are seeing?

So promtail do not work in docker on Windows and Mac, am I right?

So promtail do not work in docker on Windows and Mac, am I right?

No this is not correct, it should work.

However because docker runs in a virtual machine on these operating systems (unless you are using docker windows images but this is a different story, or WSL2 which is a little different story too), you will have to volume mount the local paths into the promtail container for promtail to access them.

but this situation with promtail not only on Windows - the same is on Mac !

thank you for the idea to mount volumes and use it in promtail internally

I have the same problem using promtail as a sidecar, I can see the content of log files in the promtail container but promtail says no files matched requested path, nothing will be tailed and target page in the promtail’s UI is empthy

Yes the solution shared by @ewelch is correct the volumes need to be mounted, in case you are using docker, for example :

  • “C:/Windows/Logs/CBS/CBS.log:/var/log/*log”

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.