# Creating new virtual server issues

**URL:** <https://forum.virtualmin.com/t/creating-new-virtual-server-issues/117185>\
**Category:** Virtualmin\
**Created:** [October 4, 2022, 1:35pm UTC](https://forum.virtualmin.com/t/creating-new-virtual-server-issues/117185 "2022-10-04T13:35:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [October 4, 2022, 8:30pm UTC](https://forum.virtualmin.com/t/creating-new-virtual-server-issues/117185/2 "2022-10-04T20:30:58Z")

</div>

Hello,

> [@gstlouis](#):
>
> However, setting up a new server recently, and I noticed that several things failed when it was doing its thing.

This is a known bug. It can be fixed easily :

> [@BIND DNS Server uninstalled - chroot issue on 1.999-x update](https://forum.virtualmin.com/t/bind-dns-server-uninstalled-chroot-issue-on-1-999-x-update/116410/27):
>
> We don’t have ETA. [That shouldn’t be the case. Simply run the following command to fix a Webmin Bind config on CentOS 7: The fix is here:

> [@gstlouis](#):
>
> My questions is: Why would webilizer, spam filtering and virus filtering fail? I mean they are not really related to DNS right?

And that is a very good question!

@Jamie, I have taken a very deep look to this problem. I think it needs your close attention. I think the code in either `read_file_lines` or `flush_file_lines` has a bug.

This is what I found out. The Virtualmin function `try_function` runs `$rv = &$func(@args)` in `eval` block. As this block called (i.e. failing `dns_setup` in this case), and when a config file is missing that is being read in `read_file_lines` sub, **it still makes its** way to `%main::file_cache`, and later when `flush_file_lines` is called without an argument, that un-existent file first gets to `@files` and then to `open_tempfile` and eventually fails.

While running tests I made it work locally by changing `flush_file_lines` and making sure that files taken from `%main:file_cache` can be read by adding one extra line to the line 3607:

```auto
@files = grep { -r "$_" } @files;

```

That local fix made the code execute as expected. Although, I suspect that you may want to solve it some other way, for example not adding file to the cache at the first place, if it cannot be read.

**This issue can be reproduced in a very simple steps:**

1. Go to BIND module config and set `chroot` to something un-existent, i.e. `/var/named/chroot/etc`
2. Go to Virtualmin and create a new domain with and without DNS feature enabled:

- In case DNS feature is enabled all irrelevant to DNS features that call `flush_file_lines()` without an argument will fail false-positively as OP described
- In case DNS feature is not selected upon domain creation all works as expected

---

_[View the full topic](https://forum.virtualmin.com/t/creating-new-virtual-server-issues/117185)._
