question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conditionally symlink 'latest' directory

See original GitHub issue

Description

Add a configuration setting for [scheduler] which defaults to true, which is used for conditionally calling FileProcessorHandler._symlink_latest_log_directory().

Use case / motivation

(I’m happy to submit PR for this if it’s not rejected!)

If base_log_folder resides on a file mount, backed by a storage service that doesn’t support symlinks (for us, Azure Blobs or Azure Files), the scheduler logs receive these lines every time the FileProcessorHandler class is instantiated: {file_processor_handler.py:126} WARNING - OSError while attempting to symlink the latest log directory.

Since this will never work for us, it’s a distraction for humans reading logs, and a tiny amount of futile extra work for the scheduler.

Unsure how many people this affects. I suppose an alternative for our specific case would be to create an Azure file handler, use local os disk for base_log_folder, and clear out local files older than n hours.

Related Issues

I could not find a related issue in Github.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
flolascommented, Aug 15, 2020

For Azure Files as a workaround I solved adding mfsymlinks option on mount command. See: https://docs.microsoft.com/en-us/azure/storage/files/storage-troubleshoot-linux-file-connection-problems

Edit: Only works in AKS using a storageclass

0reactions
chinwobblecommented, Nov 20, 2021

@chinwobble - what is the behaviour you observe? Can you paste some logs/errors you see?

We are using externally mounted azure file share to store our logs (which is expensive). We aren’t getting any errors. We use a datadog agent to scan the logs folder and ingest all our log files. The symlinking is causing the same files to be ingested twice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I setup a symlink to the most recent folder?
I want to set up a symlink to the most recent. Now, there may be more recent directories created, so ideally, the symlink...
Read more >
Can we have conditional statements in symbolic links in Linux?
A symbolic link is not in itself an executable statement, so it can't be a conditional. A symlink is merely a file that...
Read more >
Creating conditional symlink - The UNIX and Linux Forums
I am looking for a way to create a symlink which will point to last 1000 lines of a logfile. The link will...
Read more >
How to find all soft links (symbolic links) in current directory?
See 'CONDITIONAL EXPRESSIONS' in man bash – in this case you want -h : for file in * do if [ -h "$file"...
Read more >
Symbolic link - Wikipedia
In computing, a symbolic link is a file whose purpose is to point to a file or directory (called the "target") by specifying...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found