Create virtual host throws error but still appears to create

I ran the create a number of times, which always threw an error, but didn’t refresh the Virtual Hosts page, so didn’t notice that it looked like it had actually worked each time. I think this error display is the correct one for the the instance that is shown on the far right of the screen shot:


Here is the trace task:

{“context”:{“action”:“create-vhost”,“data”:{“AllowUrlfOpen”:“disabled”,“Indexes”:“disabled”,“MaxExecutionTime”:0,“MaxFileUploads”:20,“MemoryLimit”:128,“PhpVersion”:“”,“PostMaxSize”:8,“ServerNames”:[“tester.bogolinux.net”],“UploadMaxFilesize”:4,“http2https”:true,“lets_encrypt”:false,“status”:“enabled”},“extra”:{“description”:“Configuring…”,“title”:“Applying virtual host settings”},“id”:“2d715bc1-5f31-4c94-a3ea-00e2b10c201e”,“parent”:“”,“queue”:“module/webserver1/tasks”,“timestamp”:“2024-02-13T03:22:09.991711513Z”,“user”:“admin”},“status”:“aborted”,“progress”:66,“subTasks”:[{“context”:{“action”:“set-route”,“data”:{“host”:“tester.bogolinux.net”,“http2https”:true,“instance”:“webserver1-tester.bogolinux.net”,“lets_encrypt”:false,“url”:“http://127.0.0.1:20011”},“extra”:{},“id”:“ae5990e5-3317-4dc0-983d-3cc586b856bc”,“parent”:“2d715bc1-5f31-4c94-a3ea-00e2b10c201e”,“queue”:“module/traefik1/tasks”,“timestamp”:“2024-02-13T03:22:11.217443385Z”,“user”:“module/webserver1”},“status”:“validation-failed”,“progress”:0,“subTasks”:,“result”:{“error”:“Validation errors: [instance: Does not match pattern ‘[1]+$’]\n”,“exit_code”:10,“file”:“task/module/traefik1/ae5990e5-3317-4dc0-983d-3cc586b856bc”,“output”:[{“error”:“instance_pattern”,“field”:“instance”,“parameter”:“instance”,“value”:“webserver1-tester.bogolinux.net”}]}}],“validated”:true,“result”:{“error”:“Assertion failed\n File "/home/webserver1/.config/actions/create-vhost/40traefik", line 59, in \n agent.assert_exp(response[‘exit_code’] == 0)\n”,“exit_code”:2,“file”:“task/module/webserver1/2d715bc1-5f31-4c94-a3ea-00e2b10c201e”,“output”:“”}}

Cheers


  1. a-zA-Z0-9_- ↩︎

3 Likes

I encountered the same problem.
It could be from: please compare the two screenshots, the highlighter zones.

2 Likes

Will take a look asap seems like a bug

1 Like

I have reproduced this on a fresh install.

1 Like

I can confirm this is also happening for me on a fresh install.

2 Likes

the validation of the traefik set-route was a bit too strict, we need to accept the dot (.) . Therefore the route creation of the vhost of webserver was failing because we create the route instance name with something like webserver1-www.foo.org

brave are needed to test the fix

curl https://raw.githubusercontent.com/NethServer/ns8-core/main/core/install.sh > install.sh

bash +x install.sh ghcr.io/nethserver/traefik:2.1.2-dev.1

Then follow the QA

1 Like

I activated the “testing repository” and made the update for core8 - traefick. Now I was able to modify the Virtual host created previously and the validation was done without problems. By activating the “Request for a Let’s Encrypt certificate” option, I automatically obtained the certificate.
Thank you!

PS:
After these changes, I was able to install wordpress without any problem, following this tutorial: Install wordpress to NS8 - Howto - NethServer Community

1 Like