Project

General

Profile

Bug #40106

Check DNS before allowing plugins to continue and raise an error if check fails

Added by Rishabh Chauhan about 2 years ago. Updated about 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Severity:
Med High
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

This results in failure of installation of the plugin itself if the license is not present.
Error while installing a few plugins
Error: concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(call_item.args, **call_item.kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 122, in main_worker
res = loop.run_until_complete(coro)
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 82, in _run
return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 662, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 248, in fetch
iocage.fetch(
*options)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 909, in fetch
props, accept_license=accept, official=official)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 690, in fetch_plugin_index
props, 0, accept_license)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 127, in fetch_plugin
_conf, pkg, props, repo_dir)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 476, in fetch_plugin_install_packages
silent=self.silent)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_common.py", line 83, in logit
_callback({"level": level, "message": msg}, exit_on_error)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_common.py", line 62, in callback
raise RuntimeError(message)
RuntimeError: pkg error, refusing to fetch artifact and run post_install.sh!

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 332, in run
await self.future
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 356, in _run_body
rv = await self.middleware._call_worker(self.serviceobj, self.method_name, *self.args, job={'id': self.id})
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 977, in _call_worker
job,
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 908, in run_in_proc
return await self.run_in_executor(self.
_procpool, method, *args, **kwargs)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
return self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 902, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
RuntimeError: pkg error, refusing to fetch artifact and run post_install.sh!

INVESTIGATION: after investigating with miwi we realized that rssi need some certificate and new UI is failing at that, although if installed via console, you can bypass it and install it...
Refer:

root@qa03:/home/miwi/iocage-ix-plugins # iocage fetch -P -n ./irssi.json ip4_addr="igb0|10.20.20.245" boot=on
Plugin: irssi1
Official Plugin: True
Using RELEASE: 11.2-RELEASE
Post-install Artifact: https://github.com/freenas/iocage-plugin-irssi.git
These pkgs will be installed:
- irc/irssi
This plugin requires accepting a license to proceed:
404: Not Found

Do you agree? (y/N) y
Fetching artifact...
Running post_install.sh

Command output:
:ogin to your irssit host and start irssi. Happy chatting

root@qa03:/home/miwi/iocage-ix-plugins # jls
JID IP Address Hostname Path
1 10.20.20.240 cloudstack /iocage/jails/cloudstack/root
3 gitlab /iocage/jails/gitlab/root
42 nextcloud /iocage/jails/nextcloud/root
73 10.20.20.244 cloudstack1 /iocage/jails/cloudstack1/root
75 10.20.20.245 irssi1 /iocage/jails/irssi1/root
root@qa03:/home/miwi/iocage-ix-plugins # jexec 75
root@irssi1:/ # whereis irssi
irssi: /usr/local/bin/irssi /usr/local/man/man1/irssi.1.gz

dns_plugin_error.png (150 KB) dns_plugin_error.png Aaron St. John, 08/14/2018 06:26 AM
24300

Related issues

Related to FreeNAS - Feature #38878: Switch iocage plugin infrastructure to FreeBSD 11.2-RELEASEDone
Related to FreeNAS - Bug #37870: Plugins will not install fail with {repo} could not be reached, please check your DNS Closed

History

#1 Updated by William Grzybowski about 2 years ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from Backlog to 11.2-BETA3
  • Severity changed from New to Med High

Waqar, can you investigate this please? It seems when a plugin has no license it raises that error, which we need to handle and ignore that exception.

#2 Updated by Dru Lavigne about 2 years ago

  • Related to Feature #38878: Switch iocage plugin infrastructure to FreeBSD 11.2-RELEASE added

#3 Updated by Waqar Ahmed about 2 years ago

  • Status changed from Unscreened to In Progress

#4 Updated by Brandon Schneider about 2 years ago

  • Subject changed from Plugin installation checks the license before installation to Check DNS before allowing plugins to continue, and use a clearer pkg error
  • Assignee changed from Waqar Ahmed to Brandon Schneider

#5 Updated by William Grzybowski about 2 years ago

  • Related to Bug #37870: Plugins will not install fail with {repo} could not be reached, please check your DNS added

#6 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Check DNS before allowing plugins to continue, and use a clearer pkg error to Do not require a license for open source iocage plugins
  • Status changed from In Progress to Ready for Testing
  • Assignee changed from Brandon Schneider to Martin Wilke
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#7 Updated by Brandon Schneider about 2 years ago

  • Subject changed from Do not require a license for open source iocage plugins to Check DNS before allowing plugins to continue, and use a clearer pkg error
  • Status changed from Ready for Testing to In Progress
  • Assignee changed from Martin Wilke to Brandon Schneider
  • Needs Doc changed from No to Yes
  • Needs Merging changed from No to Yes

PR: https://github.com/freenas/iocage/pull/10
DESC: Check DNS before allowing plugins to install, along with various other related improvements noted in the PR
RISK: Low
ACCEPTANCE: Use a false dns (resolver="nameserver SOMEIP") to iocage and try to install a plugin.

#8 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Check DNS before allowing plugins to continue, and use a clearer pkg error to Check DNS before allowing plugins to continue and use a clearer pkg error
  • Status changed from In Progress to Ready for Testing
  • Needs Merging changed from Yes to No

#9 Updated by Aaron St. John about 2 years ago

24300

Tested on FreeNAS-11.2-MASTER-201808130848

See screenshot.

#10 Updated by Dru Lavigne about 2 years ago

  • Status changed from Passed Testing to Done
  • Needs Doc changed from Yes to No

#11 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Check DNS before allowing plugins to continue and use a clearer pkg error to Check DNS before allowing plugins to continue and raise an error if check fails

Also available in: Atom PDF