Error reading file /etc/network/interfaces: unexpected line 'source-directory /etc/network/interfaces.d'

I faced the same issue after the upgrade. I changed below line:
source-directory /etc/network/interfaces.d
to:
source-directory /etc/network/interfaces.d/*
and commented the other source-directory line. But it made my server inaccessible. I could connect to the server using KVM and reverted the line to what it was while keeping the second line commented. The server became accessible but the log file was getting filled again. I just downgraded to 2.001. I hope the problem is resolved.

That is not what I suggested. source-directory is the directive we don’t handle correctly, and your change made it break in the system network, too. So, your change makes it not work anywhere.

I said to change it to source /etc/network/interfaces.d/* because we correctly parse that (and it means the same thing).

Thanks Joe.
I don’t know if it is a good idea for me to upgrade again and test the solution as it is a production server. Do you suggest to upgrade or it is better to wait for the new version?
There is also a dot in your new post before the ending star character. Does it make a difference?

Sorry, you’re right. It’s just *. It’s a shell file glob, not a regular expression. I edited my comment. (but, the comment marked “Solution” was, and remains, correct)

1 Like

Hi @Joe ,
yesterday I had the same issue and reverted to the prevoius version of webmin.

The configuration that @virtualbob posted is the same that I have.
To have a context, it is a “Public Cloud” instance launched on OVH Cloud. Maybe it is an OVH custom configuration…

1 Like

As information only, I’ve a fresh Debian 11 installation from August 2022 and also I had the below lines

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# Cloud images dynamically generate config fragments for newly
# attached interfaces. See /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d

I solved the problems with Dashboard by changing it to one line with

source /run/network/interfaces.d/*

Hi @nikkio

I’m also on OVH, having a VM! and I had the same 2 lines. So is it an OVH issue? I installed Debian 11 using the OVH script.

I think is a mix of two, OVH making weird config and Webmin not handling well this exception.
I am reading that Webmin staff already found a fix, or at least they are close.

The fact that we get stuck in an infinite loop on an unrecognized directive is obviously a bug, which will be fixed in the next Webmin release. The Solution comment in this thread provides a simple workaround.

I just realized the two source-directory two lines are not identical. Damn.

That explains a lot.

1 Like

Cool! run and etc. And noone seen it!

Hi! I was just about to point that out. Is your solution still valid given this? I followed your instructions yesterday and it fixed the problem but I wonder if it can cause any side effect.
Thanks

Yes, I noticed that and I choosed to downgrade Webmin instead of comment the line.

I’m waiting for the next release.

The solution comment has been edited to reflect the new information.

Webmin continues to not be able to parse source-directory and fails in an uncomfortable way (infinite loop), and we’re waiting on an update to fix that. If you want to work around that problem, you can change it to use source syntax, instead, which Webmin does recognize.

This does not really solve the issue. I’m running Virtualmin on Debian 11 on an AWS EC2 instance. Doing so kills the accessibility of the instance because AWS puts some network files in these directories on the fly at boot time.
We need a new vesion which doen’t reacts to these lines.

Thanks

Are you sure you’re talking about the updated information? You have both lines converted from source-directory to source syntax (with an /* on the end, so it gets all the files in that dir), and that doesn’t work? I can’t image why it wouldn’t…they are functionally the same in the network configuration scripts, as far as I can tell.

But, we’re working on a new version. 2.013 should be out soon with this fix and a couple others.

Yes I’m sure, you can try it using the AWSfree tier.

  • Launch a AWS Debian 11 EC2C instance (create a key ring if newver did it)
  • Access the instance using SSH
  • Modify the two lines.
  • Reboot

and you’ll see one error on your EC2 dashboard, if you ask for the detail it says Accessibility. And if you try to access again the EC2 intance you can’t, there’s no way to get in, no console access not even SSH access from another EC that is on the same subnet same data center using the private IP. You’re stuck outside.

1 Like

Dang. That’s awful. Sorry for leading you astray on this. I can’t imagine why it wouldn’t be able to work with source instead of source-directory. But, new Webmin with this fix is syncing now, so updating to 2.013 should resolve it.

Let me check again… To be sure

Sorry I forgot the /*, I was wrong you were right.

How to I get the 2.013 ? Website still says 7.5 for the deb.