Running Gramex on new Ubuntu 16.04 Installation - gramex

I'm having trouble running gramex in Ubuntu 16.04.
Running it inside docker works fine, which leads me to suspect that I'm missing some dependency, but can't seem to figure out which one.
This is the error that I get, any ideas?
INFO 22-Mar 11:33:21 install Gramex 1.31.0 | guide --browser=/welcome | /gramex/apps/guide | Python 3.6.4 |Anaconda, Inc.| (default, Mar 13 2018, 01:15:57) [GCC 7.2.0]
WARNING 22-Mar 11:33:21 config Missing config: /.config/gramexdata/mail/gramexmail.yaml
WARNING 22-Mar 11:33:21 watcher watch directory /.config/gramexdata/mail does not exist
INFO 22-Mar 11:33:21 config No config found: /.config/gramexdata/mail/gramexmail.yaml
Traceback (most recent call last):
File "/anaconda3/envs/gramex/bin/gramex", line 11, in <module>
sys.exit(commandline())
File "/anaconda3/envs/gramex/lib/python3.6/site-packages/gramex/__init__.py", line 172, in commandline
callback(**kwargs)
File "anaconda3/envs/gramex/lib/python3.6/site-packages/gramex/install.py", line 539, in run
gramex.init(cmd=AttrDict(app=app_config['run']))
File "anaconda3/envs/gramex/lib/python3.6/site-packages/gramex/__init__.py", line 279, in init
callback = getattr(services, key)(conf[key])
File "anaconda3/envs/gramex/lib/python3.6/site-packages/gramex/services/__init__.py", line 133, in app
if ioloop._running:
AttributeError: 'AsyncIOMainLoop' object has no attribute '_running'

Gramex 1.31 is not compatible with Tornado 5.0. This will be resolved in Gramex 1.32, which is due on 31 Mar 2018, and is tracked here

Related

Pre-commit causing the following error when trying to commit locally

I am working on a project and am required to use pre-commit.
After making a small code change, I tried to commit the change (in my local git repo). I got the following error:
dmk#DESKTOP-I1DLS2O:~/Markus$ git commit -m "Removed Grouping#marking_completed?"
[INFO] Installing environment for https://github.com/rubocop/rubocop.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Check the log at /home/dmk/.cache/pre-commit/pre-commit.log
Here is the log:
version information
pre-commit version: 2.19.0
git --version: git version 2.25.1
sys.version:
3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux
error information
An unexpected error has occurred: CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/usr/local/lib/python3.8/dist-packages/pre_commit/main.py", line 361, in main
return hook_impl(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/commands/hook_impl.py", line 238, in hook_impl
return retv | run(config, store, ns)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/commands/run.py", line 414, in run
install_hook_envs(to_install, store)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/repository.py", line 223, in install_hook_envs
_hook_install(hook)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/repository.py", line 79, in _hook_install
lang.install_environment(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/languages/ruby.py", line 133, in install_environment
helpers.run_setup_cmd(
File "/usr/local/lib/python3.8/dist-packages/pre_commit/languages/helpers.py", line 51, in run_setup_cmd
cmd_output_b(*cmd, cwd=prefix.prefix_dir, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/pre_commit/util.py", line 146, in cmd_output_b
raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('gem', 'build', 'rubocop.gemspec')
return code: 1
expected return code: 0
stdout:
Executable `ruby` not found
stderr: (none)
Other information:
I am working on a Rails project.
I am using WSL 2.
I am using Docker.
Please let me know if you require any other information.
it appears that your linux installation does not have a ruby executable (which pre-commit currently requires when language_version is not specified for language: ruby hooks)
you can install one on ubuntu/debian via sudo apt install ruby-dev
disclaimer: I created pre-commit

ansible-container docker.errors.DockerException: Error while fetching server API version

I am trying to build a container using ansible-container module on my Mac and running into the following issue.
Karthiks-MacBook-Pro:infrastructure karthikjayaraman$ ansible-container build --roles-path=/Users/karthikjayaraman/roles
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Docker™ daemon integration engine loaded. Build starting. project=infrastructure
Building service... project=infrastructure service=mdcsat
Traceback (most recent call last):
File "/usr/bin/conductor", line 11, in <module>
load_entry_point('ansible-container', 'console_scripts', 'conductor')()
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/cli.py", line 399, in conductor_commandline
**params)
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/core.py", line 700, in conductorcmd_build
cur_image_id = engine.get_image_id_by_tag(service['from'])
File "/_ansible/container/docker/engine.py", line 549, in get_image_id_by_tag
image = self.client.images.get(tag)
File "/_ansible/container/docker/engine.py", line 164, in client
self._client = docker.from_env(version='auto', timeout=timeout)
File "/usr/lib/python2.7/site-packages/docker/client.py", line 80, in from_env
**kwargs_from_env(**kwargs))
File "/usr/lib/python2.7/site-packages/docker/client.py", line 37, in __init__
self.api = APIClient(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 147, in __init__
self._version = self._retrieve_server_version()
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 174, in _retrieve_server_version
'Error while fetching server API version: {0}'.format(e)
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))
Conductor terminated. Cleaning up. command_rc=1 conductor_id=6a4f7bcb46a33b8053d22af2ecc17abaa84abddf99f80f133b921546d36c76fc save_container=False
ERROR Conductor exited with status 1
The build numbers of the components are as follows:
Karthiks-MacBook-Pro:infrastructure karthikjayaraman$ ansible --version
ansible 2.6.1
config file = /Users/karthikjayaraman/mdc/mdc/tools/infrastructure/ansible.cfg
configured module search path = [u'/Users/karthikjayaraman/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /Library/Python/2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
Karthiks-MacBook-Pro:infrastructure karthikjayaraman$ docker --version
Docker version 18.03.1-ce, build 9ee9f40
Karthiks-MacBook-Pro:infrastructure karthikjayaraman$ ansible-container version
Ansible Container, version 0.9.2
Docker on my Mac is installed and running well.
Karthiks-MacBook-Pro:infrastructure karthikjayaraman$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Any help appreciated !.
Are you sure, you added your user account to the docker group? (your = account you run ansible-container under)
See here: https://docs.docker.com/engine/installation/linux/linux-postinstall/

Deploy IoT Edge module to a Windows device

I am creating IoT Edge using the blog https://learn.microsoft.com/en-us/azure/iot-edge/quickstart.
I have installed Python 2.7, azure-iot-edge-runtime-ctl on a Windows 1709 Virtual machine.
I am running Docker version 17.09 CE and Windows Containers. When I am trying to setup IoT-edge runtime module in Windows 10 VM.
iotedgectl setup --connection-string "{device connection string}" --auto-cert-gen-force-no-passwords
when I am running above command facing the issue, Any suggestions appreciated.
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\iotedgectl.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\edgectl\__init__.py", line 25, in coremain
return cli.execute_user_command()
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 54, in execute_user_command
(is_valid, execute_deployment_cmd) = self._process_cli_args()
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 358, in _process_cli_args
return args.func(args)
File "c:\python27\lib\site-packages\edgectl\edgecli.py", line 379, in _parse_edge_command
if EdgeDefault.is_deployment_supported(self._deployment):
File "c:\python27\lib\site-packages\edgectl\default.py", line 99, in is_deployment_supported
client = EdgeDockerClient()
File "c:\python27\lib\site-packages\edgectl\dockerclient.py", line 13, in __init__
self._client = docker.DockerClient.from_env()
File "c:\python27\lib\site-packages\docker\client.py", line 81, in from_env
**kwargs_from_env(**kwargs))
File "c:\python27\lib\site-packages\docker\client.py", line 38, in __init__
self.api = APIClient(*args, **kwargs)
File "c:\python27\lib\site-packages\docker\api\client.py", line 131, in __init__
'Install pypiwin32 package to enable npipe:// support'
docker.errors.DockerException: Install pypiwin32 package to enable npipe:// support
Any suggestions, please.
Problem Solution:
The “npipe:// broken” problem reported here applicable to Windows machines and is a problem whether Linux or Windows containers are used in Docker.
azure-iot-edge-runtime-ctl 1.0.0rc19 was released recently which addresses this issue by ensuring the correct pypiwin32 package is installed.
To get the latest bits execute:
$> pip install -U azure-iot-edge-runtime-ctl
Check installed version:
$> iotedgectl --version
iotedgectl 1.0.0rc19
Summary of issue:
iotedgectl uses library docker-py to communicate with Docker for kick starting and controlling the Edge runtime.
docker-py uses pypiwin32 for communicating with docker over named pipes (npipe). With the release of v222 of pypiwin32 docker-py is broken on Windows hosts.
As a quick workaround until the official fixes can be incorporated, iotedgectl was released which ensures that correctly working dependencies get pulled in.
Is the version of Python you have installed 2.7.14?It seems that pypiwin32 package has not been installed in your PC.Please use pip to install this package like executing the following command in your computer:
pip install pypiwin32

How to verify my docker-compose.yml?

I am setting up a container stack using docker-compose. Yet by running
docker-compose up
I get a rather cryptic error message:
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 9, in <module>
load_entry_point('docker-compose==1.4.2', 'console_scripts', 'docker-compose')()
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 39, in main
command.sys_dispatch()
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 21, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/command.py", line 27, in dispatch
super(Command, self).dispatch(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 24, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/local/lib/python2.7/dist-packages/compose/cli/command.py", line 57, in perform_command
verbose=options.get('--verbose'))
File "/usr/local/lib/python2.7/dist-packages/compose/cli/command.py", line 78, in get_project
config.load(config_details),
File "/usr/local/lib/python2.7/dist-packages/compose/config.py", line 138, in load
for service_name, service_dict in list(dictionary.items()):
AttributeError: 'NoneType' object has no attribute 'items'
How to debug? I have checked that the yml is valid, yet it doesn't work.
I forgot to save my docker-compose.yml, so it was empty.
I stumbled across the solution in this issue about making the error message better which was describing the behavior.
One gets a nice message if no docker-compose.yml exists at all:
Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml, fig.yml, fig.yaml
It was anounced on the docker-compose's issue list that there will be a nicer error message in the upcomming 1.5 release:
Top level object needs to be a dictionary. Check your .yml file that
you have defined a service at the top level.
As of version 1.7.1 the error message indicating that your file is empty reads:
ERROR: Top level object in './docker-compose.yml' needs to be an
object not '<type 'NoneType'>'.
Given the latest versions, the error message is very straightforward:
$ docker -v
Docker version 19.03.13, build 4484c46d9d
$ docker build .
failed to solve with frontend dockerfile.v0: failed to create LLB definition: the Dockerfile cannot be empty
So for ease of use, consider upgrading your docker engine.

Running html5 app template in ubuntu sdk failed?

My configuration :
Ubuntu 14.04 LTS
64bit
Qtcreator 3.1.1
everything is up-to-date
Hello everyone,
I'm trying to just compile and run an HTML5 App for ubuntu Phone, but after trying and searching for a week now, I still can't make it run !
For the moment I just want to run the simple html5 app template.
This is the situation :
I have installed ubuntu sdk as instructed in https://developer.ubuntu.com/en/start/ubuntu-sdk/installing-the-sdk/
I've created in the run click menu, an i386 build target. (15.04) --- which exited with no errors
I created an i386 emulator in devices --> i386 - devel - default password --- which is finally up and running correctly
The problem is when I compile the default template : theses are the errors I get :
desktop_Exec(app): found unexpected Exec with architecture 'all':./qtc_device_debughelper.py
security_policy_groups_safe_app(debug):(REJECT)reserved policy group 'debug':not for production use
security_policy_version_matches_framework(app.apparmor):invalid framework 'ubuntu-core-15.04'
And when I try to edit it anyway :
This is what I get :
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 29, in <module>
gi.Repository.get_default().require("UbuntuAppLaunch")
gi.RepositoryError: Typelib file for namespace 'UbuntuAppLaunch' (any version) not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 33, in <module>
from gi.repository import UpstartAppLaunch as UAL
File "/usr/lib/python3/dist-packages/gi/importer.py", line 53, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name UpstartAppLaunch, introspection typelib not found
I have been looking for this everywhere but I couldn't find something that works.
I need some of your knowledge to help me understand all this!
I have the same errors. I think that the 'ubuntu-core-15.04'-error is related to the version of Ubuntu you are using. I use Mint 17, which is based on Ubuntu 14.04. Canonical recommends the newer Ubuntu Versions for app-developing, because there is some stuff in it they changed.
unfortunately, I can't help you with the other errors.

Resources