I have trouble with sphinxcontrib-httpdomain. If i defining http get or post or any another domain, sphinx-build tells me about error
Unknown directive type "http:get"
Definition of http:post domain in my sources:
.. http:get:: /users/(int:user_id)/posts/(tag)
The posts tagged with `tag` that the user (`user_id`) wrote.
**Example request**:
.. sourcecode:: http
GET /users/123/posts/web HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"post_id": 12345,
"author_id": 123,
"tags": ["server", "web"],
"subject": "I tried Nginx"
},
{
"post_id": 12346,
"author_id": 123,
"tags": ["html5", "standards", "web"],
"subject": "We go to HTML 5"
}
]
:query sort: one of ``hit``, ``created-at``
:query offset: offset number. default is 0
:query limit: limit number. default is 30
:reqheader Accept: the response content type depends on
:mailheader:`Accept` header
:reqheader Authorization: optional OAuth token to authenticate
:resheader Content-Type: this depends on :mailheader:`Accept`
header of request
:statuscode 200: no error
:statuscode 404: there's no user
There are two blank lines before and after this block. I tried to use 3,4 spaces and to offset contents of block
Contents of extensions block of conf.py:
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinxcontrib.httpdomain'
]
What i'd tried also and it doesn't helped:
- To reinstall all sphinx* packages via pip
To reinstall all sphinx* packages via apt-get
To specify path to extension in conf.py
To reinstall all autodoc, docutils packages via pip
To build on another host (same error)
To look at build logs with -vvv mode
To read [official plugin docs][3] and do all of steps
Some information which can be useful:
All packages are installed to /usr/local/lib/python2.7/dist-packages
pip show sphinx output:
Name: Sphinx
Version: 1.6.7
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg#python.org
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: sphinxcontrib-websupport, babel, imagesize, setuptools, typing, Pygments, requests, six, docutils, alabaster, Jinja2, snowballstemmer
pip show sphinxcontrib-httpdomain output:
Name: sphinxcontrib-httpdomain
Version: 1.6.0
Summary: Sphinx domain for documenting HTTP APIs
Home-page: https://github.com/sphinx-contrib/httpdomain
Author: Hong Minhee
Author-email: hong.minhee#gmail.com
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, Sphinx
uname output:
Linux 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
After fighting with this problem for a while, I finally found the solution. The version included in Debian buster and Ubuntu bionic (and newer) has a patch added which solved an issue, but added this problem.
The patch comes from this commit, but it is missing the fix added a couple of days after in this other commit.
It seems that even if you tried to install with pip, you were using the system version. You can patch it trivially by editing the code at /usr/lib/python2/dist-packages/sphinxcontrib/httpdomain.py.
I am sending the patch to the package maintainer so it hopefully will be fixed soon in unstable.
Related
I am trying to get the src and version details using the ansible-galaxy cli without using the internet for example :
[ansible#server exam]$ ansible-galaxy info bennojoy.ntp
Role: bennojoy.ntp
description: ansible role ntp
active: True
commit:
commit_message:
commit_url:
company: AnsibleWorks
created: 2013-12-19T01:25:11.835644Z
dependencies: []
download_count: 110946
forks_count: 0
galaxy_info:
author: Benno Joy
categories: ['development']
company: AnsibleWorks
license: BSD
min_ansible_version: 1.4
platforms: [{'name': 'EL', 'versions': [5, 6]}, {'name': 'Fedora', 'v>
github_branch: master
github_repo: ntp
github_user: bennojoy
id: 4
imported: None
install_date: Sun Jul 26 10:25:09 2020
installed_version:
is_valid: True
issue_tracker_url: https://github.com/bennojoy/ntp/issues
license: BSD
min_ansible_version: 1.4
modified: 2018-06-30T00:28:28.738481Z
open_issues_count: 0
path: ('/home/ansible/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansi>
role_type: ANS
stargazers_count: 24
travis_status_url:
I am not able to get the src and version from the above. I am only able to get the src details upon installing as shown below :
[ansible#server exam]$ ansible-galaxy install bennojoy.ntp
downloading role from https://github.com/bennojoy/ntp/archive/master.tar.gz
extracting bennojoy.ntp to /home/ansible/.ansible/roles/bennojoy.ntp
bennojoy.ntp was installed successfully
In this case the src is https://github.com/bennojoy/ntp/archive/master.tar.gz. The version available for a role i need to check through the website. I would like to check if i can do this only via cli only by issuing some command instead ?
I have a rsyslogd instance running, producing the following JSON from syslog:
{"timegenerated":"2019-01-28T09:24:37.033990+00:00","type":"syslog","host":"REDACTED_HOSTNAME","host-ip":"REDACTED_IP","message":"<190>Jan 28 2019 10:24:35: %ASA-X-XXXXXX: Teardown TCP connection 82257709 for outside:REDACTED_IP\/REDACTED_PORT(LOCAL\ususername) to inside:REDACTED_IP\/REDACTED_PORT duration 0:01:52 bytes XXXX TCP FINs from outside (ususername)"}
This is invalid JSON, as the \ususe is interpreted as a hex representation of a unicode symbol. It should have been escaped as \\ususe.
I noticed on GitHub that there were an open issue (https://github.com/rsyslog/rsyslog/issues/1235), although it mentions another issue that resulted in a merged fix.
Here's some system info:
:~# rsyslogd -version
rsyslogd 8.24.0, compiled with:
PLATFORM: x86_64-pc-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
memory allocator: system default
Runtime Instrumentation (slow code): No
uuid support: Yes
Number of Bits in RainerScript integers: 64
:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
Template used to create the JSON document is:
template(name="json_syslog"
type="list") {
constant(value="{")
constant(value="\"timegenerated\":\"") property(name="timegenerated" dateFormat="rfc3339")
constant(value="\",\"type\":\"syslograw")
constant(value="\",\"host\":\"") property(name="fromhost")
constant(value="\",\"host-ip\":\"") property(name="fromhost-ip")
constant(value="\",\"message\":\"") property(name="rawmsg" format="jsonr")
constant(value="\"}\n")
Is there any functionality in rsyslog that would allow me to fix this, or does it seem like an upstream bug?
I notice you are using format="jsonr" in the template for the message. There is a difference if you use json instead of jsonr, which the documentation describes very briefly as avoids double escaping the value. Using a template with
constant(value="\",\n\"json\":\"") property(name="rawmsg" format="json")
constant(value="\",\n\"jsonr\":\"") property(name="rawmsg" format="jsonr")
and providing input containing
LOCAL\ususer "abc"
produces the 2 lines
"json":"LOCAL\\ususer \"abc\",
"jsonr":"LOCAL\ususer \"abc\",
in which the json format has escaped the \u into \\u (tested with rsyslog-8.27.0).
If this is not right for you, you can always manipulate the message, for example as follows, adding before your action:
set $.msg2 = replace($rawmsg, "\\u", "\\\\u");
and in your template use
constant(value="\",\"message\":\"") property(name="$.msg2" format="jsonr")
The replace function does a global replace, so you may want to restrict it, for example with
set $.msg2 = replace($rawmsg, "LOCAL\\u", "LOCAL\\\\u");
When using gsutil to copy a file it hangs indefinitely:
gsutil cp gs://gcp-public-data-sentinel-2/index.csv.gz .
Running gsutil with with debugging gsutil -D cp outputs:
gsutil version: 4.28n
boto version: 2.48.0
python version: 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
OS: Linux 2.6.32-504.23.4.el6.x86_64
multiprocessing available: True
using cloud sdk: True
pass cloud sdk credentials to gsutil: True
config path(s): /home/gardnera/.config/gcloud/legacy_credentials/my#email/.boto
gsutil path: /u/devon0/gardnera/yes/google-cloud-sdk/platform/gsutil/gsutil
compiled crcmod: True
installed via package manager: False
editable install: False
Command being run: /u/devon0/gardnera/yes/google-cloud-sdk/platform/gsutil/gsutil -o GSUtil:default_project_id=landsatdata1 -D cp gs://gcp-public-data-sentinel-2/index.csv.gz /home/gardnera/
config_file_list: ['/home/gardnera/.config/gcloud/legacy_credentials/my#email.com/.boto']
config: [('debug', '0'), ('working_dir', '/mnt/pyami'), ('https_validate_certificates', 'true'), ('debug', '0'), ('working_dir', '/mnt/pyami'), ('default_project_id', 'landsatdata1')]
INFO 0110 17:16:21.952356 base_api.py] Calling method storage.objects.get with StorageObjectsGetRequest: <StorageObjectsGetRequest
bucket: u'gcp-public-data-sentinel-2'
object: u'index.csv.gz'
projection: ProjectionValueValuesEnum(noAcl, 1)>
INFO 0110 17:16:21.953642 base_api.py] Making http GET to https://www.googleapis.com/storage/v1/b/gcp-public-data-sentinel-2/o/index.csv.gz?fields=contentType%2Cname%2Cgeneration%2CcustomerEncryption%2Cmd5Hash%2CcontentEncoding%2Ccrc32c%2Cetag%2CmediaLink%2Csize&alt=json&projection=noAcl
INFO 0110 17:16:21.954131 base_api.py] Headers: {'accept': 'application/json',
'accept-encoding': 'gzip, deflate',
'content-length': '0',
'user-agent': 'apitools gsutil/4.28 Python/2.7.13 (linux2) google-cloud-sdk/184.0.0 analytics/disabled'}
INFO 0110 17:16:21.954305 base_api.py] Body: (none)
INFO 0110 17:16:21.954441 client.py] Attempting refresh to obtain initial access_token
but hangs indefinitely on obtain initial access_token
I've been digging into this issue for awhile now and can't seem to find any answer. Testing on other machines I am unable to replicate the issue. A reinstall of gcloud did not fix the issue.
Anyone have any thoughts as to what might be going on?
Thanks
OK looks like the problem was with the .config files. I deleted the ~/.config/gcloud folder and the issue has resolved itself
I am experimenting with creating an EC2 instance to host a Perforce server. My instance is configured with the following user data:
#!/bin/bash
# Add a newline to the ec2-user prompt string
echo PS1=\"\\n\$PS1\" >> /home/ec2-user/.bashrc
# Update all packages
yum update –y
# Install Perforce packages
# The RHEL/7 part of the baseurl should be replaced with
# the latest RHEL version that both Amazon and Perforce support
rpm –import https://package.perforce.com/perforce.pubkey
cd /etc/yum.repos.d/
echo [perforce] > perforce.repo
echo name=Perforce >> perforce.repo
echo baseurl=http://package.perforce.com/yum/rhel/7/x86_64 >> perforce.repo
echo enabled=1 >> perforce.repo
echo gpgcheck=1 >> perforce.repo
yum install –y helix-p4d
# Make directories for the server, owned by new “perforce” user
cd /opt/perforce/servers/
mkdir danware
cd danware
mkdir danware-db danware-chkpts journal
chown –R perforce:perforce danware
I have tested each of the above commands, and know that they work when executed manually in this order. However, some aspect of Amazon's base64 encode/decode system seems to be getting in the way. When I go to "Actions > Instance Settings > View/Change User Data" from the EC2 Console after launching (and passing all system checks), I see the following user data. Note how almost every hyphen "-" has been replaced with some strange "a" character.
However, I'm not sure that this is the issue, because the log file at /var/log/cloud-init-output.log gives me the following output (I replaced some repetitive text with [...] to save space). Note the line that says Failed running /var/lib/cloud/instance/scripts/part-001 I have verified that this part-001 file actually does have the correctly displayed hyphen characters.
[...]
Cloud-init v. 0.7.6 running 'modules:final' at Fri, 09 Sep 2016 06:23:39 +0000. Up 86.66 seconds.
Loaded plugins: priorities, update-motd, upgrade-helper
No Match for argument: –y
No packages marked for update
RPM version 4.11.2
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
Usage: rpm [-aKfgpqVcdLilsiv?] [-a|--all] [-f|--file] [-g|--group] [...]
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> [...]
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
helix-p4d x86_64 2016.1-1429894 perforce 24 k
Installing for dependencies:
helix-cli x86_64 2016.1-1429894 perforce 8.8 k
helix-cli-base x86_64 2016.1-1429894 perforce 1.4 M
helix-p4d-base x86_64 2016.1-1429894 perforce 3.1 k
helix-p4d-base-16.1 x86_64 2016.1-1429894 perforce 2.4 M
helix-p4dctl x86_64 2016.1-1429894 perforce 1.2 M
Transaction Summary
================================================================================
Install 1 Package (+5 Dependent packages)
Total download size: 5.0 M
Installed size: 13 M
Is this ok [y/d/N]: Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2016-09-09.06-23.dRP_r2.yumtx
/var/lib/cloud/instance/scripts/part-001: line 22: cd: /opt/perforce/servers/: No such file or directory
chown: invalid user: ‘–R’
Sep 09 06:23:41 cloud-init[2517]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
Sep 09 06:23:41 cloud-init[2517]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
Sep 09 06:23:41 cloud-init[2517]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
Cloud-init v. 0.7.6 finished at Fri, 09 Sep 2016 06:23:41 +0000. Datasource DataSourceEc2. Up 88.53 seconds
Even more annoying, I assumed that the early No Match for argument: –y line from the log file was referring to the yum update -y line from my user data. Sure enough, just running the example user data script from the EC2 documentation page, which also uses yum update -y, gives me this same error/warning! Amazon's own example script doesn't work!? So can anyone answer why A) AWS is not displaying the user data code correctly, and B) why my user data is yielding the errors shown above? The help is much appreciated!
For lines such as
yum update –y
The character you are using is a "EN DASH U+2013"
The usual character for a hyphen is "HYPHEN-MINUS U+002D"
Fix your user data source to use "hyphen minus" and have another go
I checked the character codes by cut n pasting into this online site http://www.fileformat.info/info/unicode/char/search.htm?q=-&preview=entity
Don't know if you can see the difference but this is your hyphen
yum update –y
and this is a "hyphen minus"
yum update -y
Recently started with Calabash on iOS.
I have a simple code that does a touch("label marked:'Username'") and then uses keyboard_enter_text to enter the text, but for some reason when I run this via cucumber from command line or without setting breakpoints in Rubymine the code just runs and does not produce the desired result and the touch does not seem to do anything and the keyboard is not activated. I am doing this on a real device, (I have tried various devices).
How ever if I debug the code using ruby mine using breakpoint it produces the desired result.
I have the below setup
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
$ xcodebuild -version
Xcode 6.1.1
Build version 6A2008a
$ calabash-ios version
0.11.4
curl http://:37265/version
{"app_version":"4.3",
"outcome":"SUCCESS",
"app_id":"****",
"simulator_device":"",
"version":"0.11.4",
"app_name":"***",
"iphone_app_emulated_on_ipad":false,
"4inch":true,
"git":{"remote_origin":"git#github.com:calabash\/calabash-ios-server.git",
"branch":"master","revision":"bcc992b"},
"screen_dimensions":{"scale":2,"width":640,"sample":1,"height":1136},
"iOS_version":"7.1.2",
"system":"iPhone5,2","simulator":""}
I have checked that My App is linked with the correct calabash.framework and that it matches the gem version 0.11.4
When I debug using ruby mine then the steps run successfully (the touch works and the keyboard is activated), how ever when I run from command line or run without breakpoints in Ruby mine, the touch just seems to fail without issuing any warnings or errors. Not sure what is causing it, I have upgraded from Xcode 6.1 to Xcode 6.1.1 and that too did not help.
I have noticed similar issues reported by people in the past, but they have been around older versions of the calabash iOS gem and supposed to have been fixed in 0.11.4
When I run the app in DEBUG mode with DEBUG=1 and HTTP_DEBUG=1 I can see below
Command line run in which touch does not do anything
`
! CONNECT TO <ip>:37265
! CONNECTION ESTABLISHED
POST /map HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: HTTPClient/1.0 (2.3.4.1, ruby 2.1.5 (2014-11-13))
Accept: */*
Date: Fri, 27 Feb 2015 16:19:55 GMT
Content-Length: 97
Host: <ip>:37265
{"query":"view marked:'Problems signing in?'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 66
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Date: Fri, 27 Feb 2015 16:19:56 GMT
Accept-Ranges: bytes
Access-Control-Max-Age: 3000
{"status_bar_orientation":"down","results":[],"outcome":"SUCCESS"}
`
Debug run from ruby mine using breakpoint
CONNECT TO <ip>:37265
! CONNECTION ESTABLISHED
POST /map HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: HTTPClient/1.0 (2.3.4.1, ruby 1.9.3 (2013-06-27))
Accept: */*
Date: Fri, 27 Feb 2015 16:18:07 GMT
Content-Length: 97
Host: <ip>:37265
{"query":"view marked:'Problems signing in?'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 478
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Date: Fri, 27 Feb 2015 16:18:08 GMT
Accept-Ranges: bytes
Access-Control-Max-Age: 3000
{"status_bar_orientation":"down","results":[{"text":"Problems signing in?","enabled":true,"rect":{"center_x":160,"y":504,"width":200,"x":60,"center_y":526,"height":44},"id":null,"description":"<UILabel: 0x14dde8d0; frame = (60 504; 200 44); text = 'Problems signing in?'; gestureRecognizers = <NSArray: 0x14dde1f0>; layer = <CALayer: 0x14dde980>>","label":"Problems signing in?","alpha":1,"class":"UILabel","frame":{"y":504,"width":200,"x":60,"height":44}}],"outcome":"SUCCESS"}= Request
`
As we can see the debug run in Rubymine seems to return information about frame ordinates that are missing in the first run
The log output at /var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/run_loop20150227-8208-1g7ccvv/run_loop.out for the failed run
2015-02-27 16:19:51.871 instruments[8229:591f] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-27 16:19:56 +0000 Default: OUTPUT_JSON:
{"status":"success","value":true,"index":0}
END_OUTPUT
And for the successful debug run (that activated the touch and the keyboard) at /var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/run_loop20150227-7941-1c6mznp/run_loop.out
2015-02-27 16:18:00.085 instruments[7962:4f17] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-27 16:18:04 +0000 Default: OUTPUT_JSON:
{"status":"success","value":true,"index":0}
END_OUTPUT
The run_loop.out does not seem to give any indication either.
Am I missing something ? Why does the touch not have any effect and not activate the keyboard. Any help is appreciated.
I have a couple of suggestions. These are not definitive answers, but the text is too long for a comment.
I have noticed similar issues reported by people in the past, but they have been around older versions of the calabash iOS gem and supposed to have been fixed in 0.11.4
Can you update your gem and server to the latest 0.13.0? There have been many fixes since 0.11.4.
Is it possible that you are seeing this: NSLog output can cause apps to become unresponsive during testing.?
works when debugging
I suspect this is because of timing issue, but I cannot confirm until I see some Steps or a list of commands executed in the irb.