gnome.gtk-doc() gives permission denied error in Yocto (do_install) - gtk

I am trying to generate HTML docs using meson build. I used gnome.gtkdoc() method for this from meson build system.
Following is my meson.build file
project('mydoc', 'c',
version: '0.1.0')
gnome = import('gnome')
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
content_files = [
'docbook-mydoc.xml',
]
gnome.gtkdoc('mydoc',
main_xml : 'main-doc.xml',
src_dir : [
join_paths(meson.source_root())
],
fixxref_args: [
'--html-dir=' + (gnome.gtkdoc_html_dir(meson.project_name())),
'--extra-dir=#0#'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=#0#'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=#0#'.format(join_paths(glib_docpath, 'gio')),
],
content_files: content_files,
install : true,
install_dir: join_paths(meson.source_root(), 'doc')
)
Above meson.build works fine and can generates HTML pages. I have problem when running above meson.build in Yocto. It gives me Permission denied error while do_install operation.
ERROR: ['gtkdoc-mkhtml', '--path=/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/git/:/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/build/', 'mydoc', '../main-doc.xml'] failed with status 1
Traceback (most recent call last):
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/bin/gtkdoc-mkhtml", line 51, in <module>
sys.exit(mkhtml.run(options))
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/share/gtk-doc/python/gtkdoc/mkhtml.py", line 93, in run
quiet] + remaining_args + [gtkdocdir + '/gtk-doc.xsl', document])
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/share/gtk-doc/python/gtkdoc/mkhtml.py", line 42, in run_xsltproc
return subprocess.call(command + args)
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 339, in call
with Popen(*popenargs, **kwargs) as p:
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: ''
I am not sure why its gave me permission denied error. Any help will be appreciated.

It's a bit suspicious that you are trying to install into source root directory with
install_dir: join_paths(meson.source_root(), 'doc')
Typically, it's just directory name relative to gtk-doc html dir (gnome.gtkdoc_html_dir()) or not set at all - then directory is module
name. So try just remove it...
Update
You might be missing prefix for project html dir (for --html-dir )and it should look like:
'--html-dir=' + join_paths(get_option('prefix'), gnome.gtkdoc_html_dir(meson.project_name()),
Note. And instead of generating gtk doc path, it should be more reliable to use above mentioned function:
'--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
...

Related

Odoo 16: Playing with translations and Boom ! No longer can access my custom model data in my server

After successfully adding a pot file to my new i18n folder in my local machine, as well as setting "translate=True" in a couple of fields in my carddecks module, and verifying that in localhost I could acess my model data, I decided to update my server.
But when I try to access my model data I get the following error:
LINE 1: ..."write_date", COALESCE("carddecks_card"."cardText"->>'pt_PT'...
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
Anyone might know what may be causing this?
source code for the module can be found at https://github.com/diogocsc/carddecks
Full error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1579, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 134, in retrying
result = func()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1608, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1805, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 144, in _dispatch
result = endpoint(**request.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 457, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 430, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/models/models.py", line 62, in web_search_read
records = self.search_read(domain, fields, offset=offset, limit=limit, order=order)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4968, in search_read
result = records.read(fields, **read_kwargs)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 2992, in read
self._read(stored_fields)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3235, in _read
cr.execute(query_str, params + [sub_ids])
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 315, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: operator does not exist: character varying ->> unknown
LINE 1: ..."write_date", COALESCE("carddecks_card"."cardText"->>'pt_PT'...
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
The above server error caused the following client error:
OwlError: The following error occurred in onWillStart: "Odoo Server Error"
at wrapError (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1445:77)
at onWillStart (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1451:117)
at useModel (https://www.relationalgames.com/web/assets/505-11285c6/web.assets_backend.min.js:4709:1)
at ListController.setup (https://www.relationalgames.com/web/assets/505-11285c6/web.assets_backend.min.js:4430:645)
at new ComponentNode (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1407:136)
at https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1929:6
at View.slot1 (eval at compile (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1892:370), <anonymous>:15:36)
at callSlot (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1508:25)
at WithSearch.template (eval at compile (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1892:370), <anonymous>:8:12)
at Fiber._render (https://www.relationalgames.com/web/assets/504-41b52e3/web.assets_common.min.js:1336:96)
Caused by: RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (https://www.relationalgames.com/web/assets/505-11285c6/web.assets_backend.min.js:967:163)
at XMLHttpRequest.<anonymous> (https://www.relationalgames.com/web/assets/505-11285c6/web.assets_backend.min.js:974:13)
Found the answer for this. In my localhost I was updating my module. In my server i was just running docker-compose up. Not updating the module in the db.
The solution was going to settings -> apps search by cardecks and upgrade it.

Stackstorm - Jira pack actions via UI/Rest Api - Failed with 'oauth' method

I am trying to create a issue with Jira pack and with I am trying to oauth with token i am getting the following error:
{
"stdout": "",
"stderr": "Traceback (most recent call last):
File \"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/utils.py\", line 132, in get_action_class_instance
action_instance = action_cls(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'action_service'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>
obj.run()
File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 213, in run
action = self._get_action_instance()
File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 290, in _get_action_instance
action_instance = get_action_class_instance(
File \"/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/runners/utils.py\", line 143, in get_action_class_instance
action_instance = action_cls(**kwargs)
File \"/opt/stackstorm/packs/jira/actions/lib/base.py\", line 17, in __init__
self._client = self._get_client()
File \"/opt/stackstorm/packs/jira/actions/lib/base.py\", line 27, in _get_client
rsa_cert_file = config['rsa_cert_file']
KeyError: 'rsa_cert_file'
3:01
Tried to create an issue via StackStorm with the UI/RestApi.
Failed with oauth method and success with basic method.
Can someone suggest how can i resolve this?
Thanks,
Or Hasson

AttributeError: module 'os' has no attribute 'getcwd'?

i am trying to run a python program which takes input from the users like,directory name,file name and its content and then i try to create the directory in the current path with the file and then write the data into it but i get an error that "os has no attribute mkdir".
//Code
import os
print(os.getcwd())
class createfile:
__name=''
__file_name=''
__input_text=''
def read_and_create(self):
name = input("Enter the directory name, you want to create: ")
os.mkdir(self.__name)
#sdos.mkdir(self.__name)
self.__file_name=input("Enter the file name, you want to create: ")
f=open(self.___file_name,'w')
self.__input_text=input("Enter the text : ")
f.write(self.__input_text)
f.close()
def read_file_content(self):
x=open(self.__file_name,'r')
print(x.read())
o=createfile()
o.read_and_create()
o.read_file_content()
this is the error i got using Pycharm.
> "C:\Users\Aryan
> Kumar\AppData\Local\Programs\Python\Python37-32\python.exe"
> "C:/Users/Aryan Kumar/Desktop/0/os.py"
> Fatal Python error: initsite: Failed to import the site module
> Traceback (most recent call last):
> File "C:\Users\Aryan Kumar\AppData\Local\Programs\Python\Python37-32\lib\site.py", line 73,
> in <module>
> import os
> File "C:\Users\Aryan Kumar\Desktop\0\os.py", line 2, in <module>
> print(os.getcwd())
> AttributeError: module 'os' has no attribute 'getcwd'
>
> Process finished with exit code 1
this is the error i got using Spyder ide in anaconda environment
runfile('C:/Users/Aryan Kumar/Desktop/0/untitled0.py', wdir='C:/Users/Aryan Kumar/Desktop/0')
C:\Users\Aryan Kumar\Desktop\0
Enter the directory name, you want to create: aac
Traceback (most recent call last):
File "<ipython-input-4-fb1c179833e1>", line 1, in <module>
runfile('C:/Users/Aryan Kumar/Desktop/0/untitled0.py', wdir='C:/Users/Aryan Kumar/Desktop/0')
File "C:\Users\Aryan Kumar\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 709, in runfile
execfile(filename, namespace)
File "C:\Users\Aryan Kumar\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Aryan Kumar/Desktop/0/untitled0.py", line 32, in <module>
o.read_and_create()
File "C:/Users/Aryan Kumar/Desktop/0/untitled0.py", line 18, in read_and_create
os.mkdir(self.__name)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
This is an old question but someone might have the same problem. I also received the following error: AttributeError: module 'os' has no attribute 'getcwd'. This is because the file name is os.py. Problem solved after changing the file name.
Also found that a similar answer also provided in a different question:
https://stackoverflow.com/a/43565408/298160
Use os.curdir() in Python3 instead of os.cwd()

TypeError when executing jupyter nbconvert

I'm having trouble running jupyter nbconvert.
It always shows the following error trace (even with a notebook with a few vanilla cells)
Traceback (most recent call last):
File "/home/miguel/.virtualenvs/ipython/bin/jupyter-nbconvert", line 11, in <module>
sys.exit(main())
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/traitlets/config/application.py", line 596, in launch_instance
app.start()
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 293, in start
self.convert_notebooks()
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 447, in convert_notebooks
self.exporter = cls(config=self.config)
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 151, in __init__
super(TemplateExporter, self).__init__(config=config, **kw)
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 101, in __init__
self._init_preprocessors()
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 250, in _init_preprocessors
self.register_preprocessor(preprocessor, enabled=True)
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 211, in register_preprocessor
preprocessor_cls = import_item(preprocessor)
File "/home/miguel/.virtualenvs/ipython/local/lib/python2.7/site-packages/ipython_genutils/importstring.py", line 31, in import_item
module = __import__(package, fromlist=[obj])
TypeError: Item in ``from list'' not a string
It might be related with the nbextensions which I recently installed, since some days ago the jupyter nbconvert command used to work perfectly.
Today, I've been having some trouble installing the nbextensions. I tried using conda, but finally the it worked when I followed the instructions from here.
I had the same problem today. It seems this is a bug in nbconvert, as documented here. The solution is to edit your "jupyter_nbconvert_config.json" file. For me, this was located in my home directory by default: /home/me/.jupyter/jupyter_nbconvert_config.json
There, I changed the preprocessor strings, adding an "r" in front of them:
{
"Exporter": {
"template_path": [
".",
"/usr/lib/python2.7/site- packages/jupyter_contrib_nbextensions/templates"
],
"preprocessors": [
r"jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor",
r"jupyter_contrib_nbextensions.nbconvert_support.PyMarkdownPreprocessor"
]
},
"NbConvertApp": {
"postprocessor_class": "jupyter_contrib_nbextensions.nbconvert_support.EmbedPostProcessor"
},
"version": 1
}
Found a solution here.
Basically, you need to remove or rename your jupyter_nbconvert_config file.
This bug was fixed recently, see the details here. Run a full update for ipython or, to fix manually:
change line 31 in your ipython_genutils/importstring.py from
module = __import__(package, fromlist=[obj])
to
module = __import__(package, fromlist=[str(obj)])

Django-pipeline invalid syntax

I am trying to setup django-pipeline in my test project, however, I am running into a bug which doesn't have an obvious solution. Here is the pipeline configure in the settings.py
PIPELINE = {
'PIPELINE_ENABLED': True,
'COMPILERS': ('pipeline_browserify.compiler.BrowserifyCompiler', ),
'CSS_COMPRESSOR': 'pipeline.compressors.NoopCompressor',
'JS_COMPRESSOR': 'pipeline.compressors.uglifyjs.UglifyJSCompressor',
'STYLESHEETS': {
# 'animelist_css': {
# 'source_filenames': ( 'animelist/css/style.css', ),
# 'output_filename': 'animelist/css/animelist_css.css',
# }
},
'JAVASCRIPT': {
# 'animelist_js': {
# 'source_filenames': (
# 'animelist/js/bower_components/jquery/dist/jquery.min.js',
# 'animelist/js/bower_components/react/JSXTransformer.js',
# 'animelist/js/bower_components/react/react-with-addons.js',
# 'animelist/js/app.browserify.js',
# ),
# 'output_filename': 'animelist/js/animelist_js.js',
# }
}
}
As you can see from the configuration, this setting will allow collectstatic to run without any problem. However, collectstatic will fail if I were to uncomment those lines. The error is shown below
You have requested to collect static files at the destination
location as specified in your settings:
/var/www/anime/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/virtualenvs/django_project/lib64/python3.4/site- packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
collected = self.collect()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
for original_path, processed_path, processed in processor:
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/storage.py", line 33, in post_process
packager.pack_javascripts(package)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 112, in pack_javascripts
return self.pack(package, self.compressor.compress_js, js_compressed, templates=package.templates, **kwargs)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 105, in pack
paths = self.compile(package.paths, force=True)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 99, in compile
return self.compiler.compile(paths, force=force)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 49, in compile
from concurrent import futures
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/concurrent/futures/_base.py", line 355
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
Help is greatly appreciated.
Apparently, the error is the result of installing futures backport in pip3. Simply uninstall futures packages in your pip3.