ns-3 on Linux: error when cloning ns-3 branch - linux

I'm trying to get ns-3-dev release by the following way:
[root#localhost ns-3-allinone]# ./download.py -n ns-3-dev
#
# Get NS-3
#
Cloning ns-3 branch
=> hg clone http://code.nsnam.org/ns-3-dev ns-3-dev
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: consistency error in delta!
Traceback (most recent call last):
File "./download.py", line 316, in
sys.exit(main())
File "./download.py", line 261, in main
ns3_dir = get_ns3(options.ns3_branch)
File "./download.py", line 26, in get_ns3
run_command(['hg', 'clone', ns3_branch_url, ns3_dir])
File "/mercurial/mercurial-2.5.1/mercurial/repos/ns-3-allinone/util.py", line 24, in run_command
raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['hg', 'clone', 'http://code.nsnam.org/ns-3-dev', 'ns-3-dev'] exited with code 255
However, I can clone the directory ns-3-allinone:
[root#localhost repos]# hg clone http://code.nsnam.org/ns-3-allinone
destination directory: ns-3-allinone
requesting all changes
adding changesets
adding manifests
adding file changes
added 55 changesets with 78 changes to 7 files
updating to branch default
7 files updated, 0 files merged, 0 files removed, 0 files unresolved
Why I can't get a copy of ns-3-dev?

It looks like the upstream ns-3-dev repository might be corrupted. Whoever runs it should be sure to run hg verify on it.

Related

azure_rm Ansible plugin fails to parse dynamic inventory

I'm unable to create an Ansible dynamic inventory for Azure. I get the following error:
bash-5.1# ansible-inventory -i inventory_azure_rm.yaml --graph -vvv
ansible-inventory [core 2.12.2]
config file = /playbook/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-inventory
python version = 3.9.7 (default, Nov 24 2021, 21:15:59) [GCC 10.3.1 20211027]
jinja version = 3.0.3
libyaml = False
Using /playbook/ansible.cfg as config file
host_list declined parsing /playbook/inventory_azure_rm.yaml as it did not pass its verify_file() method
toml declined parsing /playbook/inventory_azure_rm.yaml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /playbook/inventory_azure_rm.yaml with script plugin: problem running /playbook/inventory_azure_rm.yaml --list ([Errno 13] Permission denied:
'/playbook/inventory_azure_rm.yaml')
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3.9/site-packages/ansible/plugins/inventory/script.py", line 150, in parse
raise AnsibleParserError(to_native(e))
[WARNING]: * Failed to parse /playbook/inventory_azure_rm.yaml with auto plugin: name 'client_secret' is not defined
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3.9/site-packages/ansible/plugins/inventory/auto.py", line 58, in parse
plugin.parse(inventory, loader, path, cache=cache)
File "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 219, in parse
self._credential_setup()
File "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py", line 240, in _credential_setup
self.azure_auth = AzureRMAuth(**auth_options)
File "/root/.ansible/collections/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py", line 1522, in __init__
self.azure_credential_track2 = client_secret.ClientSecretCredential(client_id=self.credentials['client_id'],
[WARNING]: * Failed to parse /playbook/inventory_azure_rm.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3.9/site-packages/ansible/plugins/inventory/yaml.py", line 112, in parse
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]: * Failed to parse /playbook/inventory_azure_rm.yaml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port.
File "/usr/lib/python3.9/site-packages/ansible/inventory/manager.py", line 290, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3.9/site-packages/ansible/plugins/inventory/ini.py", line 136, in parse
raise AnsibleParserError(e)
[WARNING]: Unable to parse /playbook/inventory_azure_rm.yaml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
#all:
|--#ungrouped:
The inventory_azure_rm.yaml file is:
plugin: azure.azcollection.azure_rm
auth_source: credential_file
plain_host_names: yes
include_vm_resource_groups:
- <redacted>
keyed_groups:
- key: tags.applicationRole
separator: ""
The ansible.cfg file is:
[defaults]
inventory = inventory_azure_rm.yaml
[inventory]
enable_plugins = host_list, script, auto, yaml, ini, toml
Ansible Azure collection version
bash-5.1# ansible-galaxy collection list
# /root/.ansible/collections/ansible_collections
Collection Version
------------------ -------
azure.azcollection 1.11.0
I would appreciate any help on trying to solve this.
Thank you.
Update:
Fixed inventory_azure_rm.yaml file permissions.
bash-5.1# ls -la inventory_azure_rm.yaml
-rw-r--r-- 1 root root 200 Feb 24 17:27 inventory_azure_rm.yaml
Updated the error stacktrace on the problem description running the command again.
Update2:
The Azure credentials file looks like this:
bash-5.1# cat ~/.azure/credentials
[default]
subscription_id=<redacted>
client_id=<redacted>
secret=<redacted>
tenant=<redacted>
cloud_environment=AzureCloud
I finally managed to fix the problem on parsing the dynamic inventory. I was doing the following:
pip install -r https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt && \
ansible-galaxy collection install azure.azcollection:1.11.0
I've changed 2 things:
Invert the order on installing the collection and its dependencies. First I need to install the azure.azcollection and after that, its dependencies.
Install the azure.azcollection dependencies from the requirements.txt coming with the collection itself instead of doing it from Github.
This is the code working:
ansible-galaxy collection install azure.azcollection:1.11.0 && \
pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
The difference between the requirements.txt file from GitHub at https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt and the local requirements.txt file at ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt is on azure-mgmt-network package version. The online version is 19.1.0 and the local (working) version is 12.0.0.
bash-5.1# diff -w requirements-azure.txt ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
--- requirements-azure.txt
+++ /root/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
## -19,7 +19,7 ##
azure-mgmt-monitor==3.0.0
azure-mgmt-managedservices==1.0.0
azure-mgmt-managementgroups==0.2.0
-azure-mgmt-network==19.1.0
+azure-mgmt-network==12.0.0
azure-mgmt-nspkg==2.0.0
azure-mgmt-privatedns==0.1.0
azure-mgmt-redis==5.0.0

Problem running odoo-bin on MacOS (ValueError: current limit exceeds maximum limit)

I am unable to get Odoo 14 running on my MacOS machine. Some research into the following error suggests that I can manually configure the memory limits which may resolve the issue but I cannot find the relevant config files on my machine.
I've checked and reinstalled all of the requirements and I can't find much information to point me in the right direction.
(venv) kilgow#wmbp odoo-dev % python3 odoo/odoo-bin
2021-09-18 15:56:53,295 1931 INFO ? odoo: Odoo version 14.0
2021-09-18 15:56:53,295 1931 INFO ? odoo: addons paths: ['/Users/kilgow/Desktop/odoo-dev/odoo/odoo/addons', '/Users/kilgow/Library/Application Support/Odoo/addons/14.0', '/Users/kilgow/Desktop/odoo-dev/odoo/addons']
2021-09-18 15:56:53,295 1931 INFO ? odoo: database: default#default:default
2021-09-18 15:56:53,351 1931 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
Traceback (most recent call last):
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo-bin", line 8, in <module>
odoo.cli.main()
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/command.py", line 61, in main
o.run(args)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/server.py", line 178, in run
main(args)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/server.py", line 172, in main
rc = odoo.service.server.start(preload=preload, stop=stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 1298, in start
rc = server.run(preload, stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 510, in run
self.start(stop=stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 452, in start
set_limit_memory_hard()
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit
(venv) kilgow#wmbp odoo-dev % python3 odoo/odoo-bin
You should check out this documentation for more info, so the easy way is add an extra argument to your run script like below.
python3 odoo-bin --addons-path=addons -d mydb --limit-memory-hard 0
I believe this could be due to the machine using an M1 chip. Manually increasing the memory limits did not resolve the problem.
I’ve managed to work around the issue by running Odoo and Postgres in Docker containers instead.

python tests using robot framework

Does anyone have a good example of testing a python program using Robot Framework.
I am trying to run my python program (chaptermarkers.py) with an argument of --test and checking the results.
Passing the argument has been an odyssey of google searches for 2 days.
[file: common_resourses.robot]
*** Settings ***
Library OperatingSystem
*** Variables ***
${CHAPTERMARKERS_EXEC} chaptermarkers
${LOG LEVEL} DEBUG
*** Keywords ***
# TODO
[Test Cases: file: default_suite.robot]
*** Settings ***
Documentation *Test Chapter Markers runs but has error in filename*
Metadata Github https://github.com/cbitterfield/chaptermarkers
Metadata Version 1.0.0
Metadata Executed At ${HOST}
# External libraries imports
Library Process
Library String
Resource common_resources.robot
*** Variables ***
${EXPECTED_MESSAGE} Movie Filename
${REPORT FILE} report.html
${LOG FILE} logfile.html
${LOG LEVEL} DEBUG
${OUTPUT DIR} /Users/colin/IdeaProjects/chaptermarkers
${test} --test
*** Test Cases ***
Scenerio test chaptermarkers run
[Tags] DEBUG
[Documentation] Verifies that chaptermarkers is executed well and without errors
${result}= Run process ${CHAPTERMARKERS_EXEC} ${test}
Should Contain ${result.stdout} ${EXPECTED_MESSAGE}
Should Be Empty ${result.stderr}
No matter how I try to put something after the program, I get an error of directory missing.
[Crazy unusable error messages]
$ robot --loglevel DEBUG --log log.html --report report.html stests/default_suite.robot
[ ERROR ] Error in file '/Users/colin/IdeaProjects/chaptermarkers/stests/default_suite.robot' on line 25: Invalid variable name '${test} --test'.
==============================================================================
Default Suite :: *Test Chapter Markers runs but has error in filename*
==============================================================================
Scenerio test chaptermarkers run :: Verifies that chaptermarkers i... | FAIL |
Variable '${test}' not found. Did you mean:
${TEST_TAGS}
${TEST_NAME}
------------------------------------------------------------------------------
Default Suite :: *Test Chapter Markers runs but has error in filen... | PASS |
0 critical tests, 0 passed, 0 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: /Users/colin/IdeaProjects/chaptermarkers/output.xml
[ ERROR ] Unexpected error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/rebot/log.html'
Traceback (most recent call last):
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/utils/application.py", line 83, in _execute
rc = self.main(arguments, **options)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/run.py", line 451, in main
writer.write_results(settings.get_rebot_settings())
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 65, in write_results
self._write_log(results.js_result, settings.log, config)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 79, in _write_log
self._write('Log', LogWriter(js_result).write, path, config)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 86, in _write
writer(path, *args)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py", line 43, in write
self._write_file(path, config, LOG)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py", line 36, in _write_file
writer.write(template)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/htmlfilewriter.py", line 33, in write
for line in HtmlTemplate(template):
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/normaltemplate.py", line 28, in __iter__
with codecs.open(self._path, encoding='UTF-8') as file:
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py", line 905, in open
file = builtins.open(filename, mode, buffering)
(env) razzamataz:chaptermarkers colin$
A few things I noticed:
There needs to be at least two spaces between ${test} and --test in your variables section. You provided only one. The same in the Run Process line, there should be at least two spaces between exec and argument. The rule is that RF uses two spaces as delimiter.
Your test name is indented. RF inteprets it as a keyword calling which is unexpected. It should start from the begining of the line without indent
The file missing error looks weired and I don't know the reason. The file is part of RF library and if you installed RF correctly, it should be there. I suggest that you start a new virtual environment and try again if it's not too complex.
P.S. Just FYI, all RF buil-in libraries can be found here:
https://robotframework.org/#libraries.

Invalid gopkg.in package and rev in

When attempting to build with Pants, I am seeing the following error:
File "build/bdist.macosx-10.10-intel/egg/pants/contrib/go/tasks/go_fetch.py", line 154, in _transitive_download_remote_libs
all_known_addresses)
File "build/bdist.macosx-10.10-intel/egg/pants/contrib/go/tasks/go_fetch.py", line 105, in _transitive_download_remote_libs
fetcher.fetch(go_remote_lib.import_path, dest=tmp_fetch_root, rev=go_remote_lib.rev)
File "build/bdist.macosx-10.10-intel/egg/pants/contrib/go/subsystems/fetchers.py", line 437, in fetch
github_root, github_rev = self._map_import_path(import_path, rev)
File "/Users/chad/.cache/pants/setup/bootstrap/pants.mbFDa8/install/lib/python2.7/site-packages/pants/util/memo.py", line 95, in memoize
result = func(*args, **kwargs)
File "build/bdist.macosx-10.10-intel/egg/pants/contrib/go/subsystems/fetchers.py", line 454, in _map_import_path
raise self.FetchError('Invalid gopkg.in package and rev in: {}'.format(import_path))
Exception message: Invalid gopkg.in package and rev in: gopkg.in/amz.v1/aws
Here is the contents of my BUILD file:
# Auto-generated by pants!
# To re-generate run: `pants buildgen.go --materialize --remote`
go_remote_library(rev='v1')
Looking into the code, I see that the error comes from a failure to match a regex in fetchers.py, on line 453.
I am running Pants version 0.0.59 on Mac OS X 10.10 (Yosemite)
Noting that #Huckphin stumbled on a bug here in pantsbuild.pants<=0.0.59. He filed an issue and now things are fixed up for handling gopkg.in remote import paths that point to sub-packages in the remote repo. The fix will be released with the regular Friday release on 11/20/2015 in 0.0.60.

vdebug - vim : not working

I am using archlinux and installed gvim and python. THen using vundle in vim, installed the plugin vdebug for vim.
I am debugging a lot of php code for last 1 year using vdebug very successfully. Suddenly from yesterday i get the following errors in vim.
Exact sequence:
I open index.php using vim.
Press F5. In the bottom it shows Waiting for a connection (Ctrl-C to cancel, this message will self-destruct in 20 seconds...)
Then go to my browser and refresh the link: http://www.mylocalsite.com/?XDEBUG_SESSION_START=1
Generally afte this the debugging starts. But since yesterday nothing happens. it keeps showing Waiting for a connection (Ctrl-C to cancel, this message will self-destruct in 20 seconds...) so after some time 40 sec, if i type enter it shows the output1 . Later I again closed the terminal and run all the steps except this time type ctrl + c instead of enter, it shows output2
OUTPUT1
Waiting for a connection (Ctrl-C to cancel, this message will self-destruct in 20 seconds...)
An error occured: <class 'vim.error'>
Traceback (most recent call last):
File "/home/simha/.vim/bundle/vdebug/plugin/python/start_vdebug.py", line 31, in run
self.runner.run()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 160, in run
self.open()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 47, in open
self.ui.open()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/ui/vimui.py", line 75, in open
raise e
error: Vim(new):E325: ATTENTION
Output2
Error detected while processing :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/simha/.vim/bundle/vdebug/plugin/python/start_vdebug.py", line 31, in run
self.runner.run()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 160, in run
self.open()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 47, in open
self.ui.open()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/ui/vimui.py", line 52, in open
self.watchwin.create()
File "/home/simha/.vim/bundle/vdebug/plugin/python/vdebug/ui/vimui.py", line 337, in create
vim.command('silent ' + self.open_cmd + ' ' + self.name)
KeyboardInterrupt
I found that there is a swap file .Debugger.swp because of which the dedugger is not working. I have deleted that file. it started working
Also any other swp files made by vdebug are also removed.

Resources