Can't disable replication task

Cheatha

Cadet
Joined
Aug 3, 2017
Messages
4
I've got two FreeNAS servers, both running the latest stable FreeNAS-11.3-U5. There is a replication task (SSH+NETCAT) via VPN from server A to server B. Server B will be offline for a few days so I wanted to stop the replication. But every time I try to disable it on server I'll get an error: »[large_block] null not allowed«

This is the complete message:
Code:
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
    io_thread=False)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/service.py", line 402, in update
    f'{self._config.namespace}.update', self, self.do_update, [id, data]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 960, in nf
    args, kwargs = clean_and_validate_args(args, kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 918, in clean_and_validate_args
    value = attr.clean(args[args_index + i])
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 594, in clean
    data[key] = attr.clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 370, in clean
    value = super().clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 76, in clean
    raise Error(self.name, 'null not allowed')
middlewared.schema.Error: [large_block] null not allowed


Replication is running fine, both servers to have ZFS large_blocks enabled. How can I disable this replication task?
 

GunbleR

Dabbler
Joined
Apr 6, 2018
Messages
10
same, on FreeNAS-11.3-U5.
unable to edit, creating new still possible.
got local ssd to hdd replication created a hour ago, if i try to edit, without even changing anything i get the same error.

Code:
[large_block] null not allowed
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
    io_thread=False)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/service.py", line 402, in update
    f'{self._config.namespace}.update', self, self.do_update, [id, data]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 960, in nf
    args, kwargs = clean_and_validate_args(args, kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 918, in clean_and_validate_args
    value = attr.clean(args[args_index + i])
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 594, in clean
    data[key] = attr.clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 370, in clean
    value = super().clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 76, in clean
    raise Error(self.name, 'null not allowed')
middlewared.schema.Error: [large_block] null not allowed


screenshot of my replication settings
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I've got two FreeNAS servers, both running the latest stable FreeNAS-11.3-U5. There is a replication task (SSH+NETCAT) via VPN from server A to server B. Server B will be offline for a few days so I wanted to stop the replication. But every time I try to disable it on server I'll get an error: »[large_block] null not allowed«

This is the complete message:
Code:
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
    io_thread=False)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/service.py", line 402, in update
    f'{self._config.namespace}.update', self, self.do_update, [id, data]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 960, in nf
    args, kwargs = clean_and_validate_args(args, kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 918, in clean_and_validate_args
    value = attr.clean(args[args_index + i])
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 594, in clean
    data[key] = attr.clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 370, in clean
    value = super().clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 76, in clean
    raise Error(self.name, 'null not allowed')
middlewared.schema.Error: [large_block] null not allowed


Replication is running fine, both servers to have ZFS large_blocks enabled. How can I disable this replication task?

This issue would seem to apply.


If so, the workaround they suggest is to go back to 11.3-U4 and enable large blocks in the replication task edit form. Then it can apparently be edited or stopped in 11.5. That's my superficial impression, so please read it for yourself in case I misunderstood!
 

Juan Manuel Palacios

Contributor
Joined
May 29, 2017
Messages
146
Hi,

Anyone know if there's a plan for a 11.3-U5.1 update to fix this, or U6? It's currently keeping me from editing my replication tasks, and I'd hate to have to reboot back into U4 to edit them, and then back into U5, every single time. Needless to say, I also don't want to permanently revert to U4.

The FreeNAS roadmap at https://jira.ixsystems.com/secure/Dashboard.jspa?selectPageId=10500 has been broken for a while already, so it's not so easy to have an idea of what the current release plans are.

Thanks,
 

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442

Juan Manuel Palacios

Contributor
Joined
May 29, 2017
Messages
146
Thanks, but that seems to be a private link, I get a "can't view" error when loading it even when logged into Jira with my (general public) account.

Thanks,
 

Cheatha

Cadet
Joined
Aug 3, 2017
Messages
4
Going back to 11.3-U4 didn't work either. I had to delete the task and recreate it. After a few days I had issues with non-existing snapshots although »Hold Pending Snapshots« was checked. After restarting from scratch it worked well for a few days, but then replication failed again due to missing snapshots. Replication seems to be broken at the moment :confused:
 

taupehat

Explorer
Joined
Dec 20, 2016
Messages
54
I had the same bug only I was trying to change one of the parameters (Speed limit). The only solution I found was to edit the task directly in freenas-v1.db via sqlite3 - HIGHLY unsupported but this bug really needs to be at a higher priority than "Medium" IMHO.
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
I've got two FreeNAS servers, both running the latest stable FreeNAS-11.3-U5. There is a replication task (SSH+NETCAT) via VPN from server A to server B. Server B will be offline for a few days so I wanted to stop the replication. But every time I try to disable it on server I'll get an error: »[large_block] null not allowed«

This is the complete message:
Code:
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
    io_thread=False)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/service.py", line 402, in update
    f'{self._config.namespace}.update', self, self.do_update, [id, data]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 960, in nf
    args, kwargs = clean_and_validate_args(args, kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 918, in clean_and_validate_args
    value = attr.clean(args[args_index + i])
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 594, in clean
    data[key] = attr.clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 370, in clean
    value = super().clean(value)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 76, in clean
    raise Error(self.name, 'null not allowed')
middlewared.schema.Error: [large_block] null not allowed


Replication is running fine, both servers to have ZFS large_blocks enabled. How can I disable this replication task?
A temporary workaround for disabling the replication task is to edit the underlying snapshot task to take the next snapshot in a year for example.
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
@taupehat yeah that is a bit sketchy to do. Does freenas have a cli by any chance? Running into the same issues where cannot edit the replication task.
 

taupehat

Explorer
Joined
Dec 20, 2016
Messages
54
@taupehat yeah that is a bit sketchy to do. Does freenas have a cli by any chance? Running into the same issues where cannot edit the replication task.
Yeah, just ssh into the freenas array. You're right about it being sketchy - I'm not a fan of sqlite in general and loathe to do this to the FreeNAS config but that's kind of the can of worms I found myself in. It did work and hasn't broken anything, but if you go that route 100% take a backup of freenas-v1.db before you start.
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
The bug is a UI issue, one-line fix merge. There seems to be no longer a cli for FreeNAS so editing replications will need to be done using the API (did not try this yet).
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
does not "need" to be done using API but it could be a reasonable workaround. Sorry just rephrasing the previous comment.
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
@Cheatha you can disable a replication task like this. For more examples refer to https://www.truenas.com/docs/hub/additional-topics/api/ws_api/ and https://www.truenas.com/docs/hub/additional-topics/api/rest_api/

username and password are the freenas UI credentials

Code:
# find the id of your replication task
curl --user {username}:{password}  --request GET 'http://{freenas-ip-or-domain}/api/v2.0/replication'

# insert id from prevous request into this url
curl --user {username}:{password} --request PUT 'http://{freenas-ip-or-domain}/api/v2.0/replication/id/{id}' \
--header 'Content-Type: application/json' \
--data-raw '{"enabled": false}'



I used the rest-api documentation but the wsl doc has explanations on different parameters.
 

Juan Manuel Palacios

Contributor
Joined
May 29, 2017
Messages
146
The bug is a UI issue, one-line fix merge. There seems to be no longer a cli for FreeNAS so editing replications will need to be done using the API (did not try this yet).

Problem is how to include that in our local copy of the FreeNAS web app. I cannot, for the live of me, figure out what local file I'd have to edit, which I'd be more than willing to do.

@Cheatha you can disable a replication task like this. For more examples refer to https://www.truenas.com/docs/hub/additional-topics/api/ws_api/ and https://www.truenas.com/docs/hub/additional-topics/api/rest_api/

username and password are the freenas UI credentials

Code:
# find the id of your replication task
curl --user {username}:{password}  --request GET 'http://{freenas-ip-or-domain}/api/v2.0/replication'

# insert id from prevous request into this url
curl --user {username}:{password} --request PUT 'http://{freenas-ip-or-domain}/api/v2.0/replication/id/{id}' \
--header 'Content-Type: application/json' \
--data-raw '{"enabled": false}'



I used the rest-api documentation but the wsl doc has explanations on different parameters.

In the mean, this API workaround gives me the tools I need to edit my tasks (other than teaching me a bit about the FreeNAS API, which I've been meaning to peek into for a while). Thank you so much, @karasjoh000!
 

karasjoh000

Cadet
Joined
Nov 2, 2020
Messages
7
take a look into `/etc/local/nginx/nginx.conf`

you will need to adjust source and recompile the angular app into /usr/local/www/webui most likely. Angular is compiled to js from ts it will be hard to modify it from source. Never tried this
 
Last edited:

Juan Manuel Palacios

Contributor
Joined
May 29, 2017
Messages
146
take a look into `/etc/local/nginx/nginx.conf`

you will need to adjust source and recompile the angular app into /usr/local/www/webui most likely. Angular is compiled to js from ts it will be hard to modify it from source. Never tried this

I've looked at that file before, for sure, but I can only find the compiled wepapp at /usr/local/www/webui, referenced in the /ui Nginx Location and seemingly installed by the freenas-webui package. And I can only imagine that I can't relate that to the commit in the FreeNAS repo because the latter is the app's source code, rather than the compiled app, and they don't ship the FreeNAS builds with that.

There's also what I believe to be the Python backend for the 2.0 API at /usr/local/lib/python3.7/site-packages/middlewared, governed by /usr/local/bin/middlewared process and proxied to by Nginx on *:6000 (but not sure installed by what package), and finally the Django app for the 1.0 API at /usr/local/www/freenasUI, governed by the /usr/local/bin/uwsgi process and proxied to by Nginx on 127.0.0.1:9042 (and seemingly installed by the freenas-ui package)... So, all in all, I'm currently not too clear on what file I'd have to edit, how I'd recompile the webui app, and why I even spent so much time on all this, when I simply just reverted to 11.3-U4.1 and edited my replication tasks there.

But, all in all, it's been a nice refresher on how FreeNAS works (I once wrote a long article on all this, plus some lower-level tidbits like GEOM classes, zpool, zdb, the CAM layer & camcontrol, diskinfo, SMART, devctl etc., but unfortunately never took it across the finish line), so it's been fun.

Thanks for all the fish!
 

Juan Manuel Palacios

Contributor
Joined
May 29, 2017
Messages
146
Hi everyone! So 12.0-U1 is out, and I see no mention of NAS-107821 being fixed in it, nor in the 12.0 release notes even though the ticket claims to have been fixed included on the latter.

Do we know if the issue is indeed fixed in any released version of FreeNAS/TrueNAS?

In the mean time, GitHub user amelchio gives us a very convenient way of applying the necessary patch locally:

 
Top