Caching Bug in GUI of DNS-Management

Hi,

there is a bug in the cached Tabs in the GUI of Nethserver. It is not critical, it is just “not nice”.
Do the following:

  1. Go to: DNS => Server alias
  2. Create a Server alias
  3. Go to: DNS => Hosts
  4. Create a Host with the Same name as the Server alias
  5. Go to: DNS => Server alias
  6. Delete the Server alias

Result:
Error 404
Nethgui: 404 - not found
1352715526

I think the reason is just because the Serveralias-Tabcontent is cached and didn’t get a trigger to refresh, after the alias is now not an alias anymore but a DNS Host-Entry.

1 Like

I think so… @davidep is Kristian right?

something more to add

you can use the same domain name (for example domain.com) between the ‘hosts’ tab and the ‘server alias’ tab of the ‘dns’ panel

Of course after that I can see the two identical domain name in the two panels and when I try to edit the ‘server alias’ name, I got a 404 error.

method :

  • set a domain name in the server alias
  • set an identical domain name in the hosts tab (we must have a validation to avoid this)
  • try to edit the domain name in the ‘server alias’ tab and you got a 404 error.

In fact we overwrite the database key( with a different type : remote or self), and it is not good, you should not use it if the key is used elsewhere. A validation is needed here

The bug is confirmed @dev_team

I saw this bug because I’m looking a way to set as reserved a domain name, in fact I want to use a domain name as a virtualhost of dokuwiki (by example) and I don’t want to use it for an ibay later. But with the approach of Neth, I worry it is not possible to block the usage of a key name. The method I known is to set the type with ‘reserved’ or whatever you need

2 Likes

one way to verify in the host tab if the key is not used in the server alias tab, but the same solution doesn’t work in the server alias tab, maybe because the class php is not exactly the same (class ServerAlias extends \Nethgui\Controller\TableController instead of class Modify extends \Nethgui\Controller\Table\Modify)

does it is needed to code the sever alias tab like the host tab ?

2 Likes

Thank you! I think we can safely merge the pull request :wink:

Just created a new bug: http://dev.nethserver.org/issues/3375

@davidep will do some magic on the web gui :slight_smile:

Think to do the same validator for the server alias tab. How can it be done ?

Add here a validate() function, like you did in DNS\Modify. I’m waiting for your PR :wink:

Edit:

you’re right, my proposal might not work at all. If you fall in troubles we can refactor ServerAlias like DNS as you said…

Magic is from @stephdl! His patch is good (I only add a translation tweak).

1 Like

new MR to test if the key is not used by the host tab

1 Like

Thanks for your patch, @stephdl! Just merged and the RPM is ready for QA. @Hunv, do you want to test it?

http://packages.nethesis.it/nethserver/6.7/testing/x86_64/Packages/nethserver-hosts-1.1.3-1.6.g54be1db.ns6.noarch.rpm

/cc @testing_team @quality_team

Yes, I can try it. Currently I don’t know how to install the testing-update.

Type the following command at the Bash prompt:

yum localinstall http://packages.nethesis.it/nethserver/6.7/testing/x86_64/Packages/nethserver-hosts-1.1.3-1.6.g54be1db.ns6.noarch.rpm

no more updates ?

Sorry, I had no time the last days. Work, Birthdaypartys, Workshops,… full schedule. Maybe this afternoon or next week.

1 Like

Seems to work, if this is the expected result:

Maybe the Message should be a little bit more detailed like “Hostname already in use for another Host or Server Alias”. Otherwise you may look in the Hosts-Page and think “hmmm… no it’s not”

1 Like

it is valid, but in the meanwhile I want to use the host database for saving a domain name as the document root of a module. So it will be useless, you will have an error because the key is used by me.

@Hunv can you test the inverse, set a domain name in host tab, and verify that in the server alias tab you cannot use it.

@stephdl Same error-message when I test the inverse.

1 Like

that’s good mate

Released in

6.7/nethserver-updates: nethserver-hosts-1.1.4-1.ns6.noarch.rpm
7.2/nethserver-testing: nethserver-hosts-1.1.4-1.13.ge4ec512.ns7.noarch.rpm

http://dev.nethserver.org/issues/3375#note-9

merci @giacomo and @davidep

3 Likes

Merci to you for the work! :wink: