Modify

Opened 5 years ago

Closed 22 months ago

#13611 closed defect (fixed)

Plugin fails on Trac 1.4

Reported by: boris.brudnoy@… Owned by: Cinc-th
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: duytscal, Gasol Wu, peter.miniar@… Trac Release: 1.4

Description

When installed and enabled, the current trunk version of the plugin breaks Trac 1.4 with a message:

 Trac detected an internal error:
  AttributeError: 'Environment' object has no attribute 'systeminfo'

Uninstalling the plugin restores Trac to working order:

$ pip uninstall TracXMLRPC
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Uninstalling TracXMLRPC-1.1.7:
  Would remove:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/TracXMLRPC-1.1.7.dist-info/*
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tracrpc/*
Proceed (y/n)? y
  Successfully uninstalled TracXMLRPC-1.1.7

Attachments (0)

Change History (29)

comment:1 Changed 5 years ago by anonymous

Since t:comment:34:ticket:11901 Plugins need to implement the ISystemInfoProvider interface instead of using systeminfo.

comment:2 Changed 5 years ago by Ryan J Ollos

Owner: changed from osimons to Ryan J Ollos
Status: newaccepted

comment:3 Changed 5 years ago by Ryan J Ollos

In 17498:

TracXMLRPC 1.1.8dev: Adapt to exception removed in Trac 1.3.1

Refs #13611.

comment:4 Changed 5 years ago by Ryan J Ollos

In 17499:

TracXMLRPC 1.1.8dev: Adapt to removal of systeminfo attribute

Refs #13611.

comment:5 Changed 5 years ago by Ryan J Ollos

There are a few more issues to fix. I will let you know when it's ready to test.

comment:6 Changed 5 years ago by Ryan J Ollos

It's too much to keep the plugin compatible all the way back to Trac 0.11. I'm going to make a branch and drop support for Trac < 1.4.

comment:7 Changed 5 years ago by anonymous

Any updates on this Ryan? Where can I check the new branch to try it out? Thanks

comment:8 Changed 5 years ago by duytscal

Cc: duytscal added

comment:9 Changed 5 years ago by Massimo

I tried with the latest SVN version, failing with

2019-11-18 13:10:06,795 Trac[loader] DEBUG: Loading plugin "tractags.xmlrpc" from "/mnt/data/trac/projects/trac-pp/plugins/TracTags-0.11.dev0-py2.7.egg"
2019-11-18 13:10:06,797 Trac[loader] ERROR: Skipping "tractags.xmlrpc = tractags.xmlrpc [tracrpc]": ImportError: cannot import name wiki_to_oneliner
...
2019-11-18 13:14:34,866 Trac[main] WARNING: [10.199.222.111] HTTPNotFound: 404 Not Found (No handler matched request to /rpc), <RequestWithSession "POST '/rpc'">, referrer None

After finding a working patch, please push to PyPI. Thanks.

comment:10 Changed 5 years ago by Gasol Wu

Cc: Gasol Wu added

comment:11 Changed 5 years ago by PeterM <peter.miniar@…>

Cc: peter.miniar@… added

comment:12 Changed 5 years ago by Massimo

Any news here? It still fails on Trac-1.4.

comment:13 Changed 5 years ago by Gasol Wu

https://github.com/Gasol/trac-xmlrpcplugin/tree/trac-1.5

I was working on this, You can try it, It should be work with Trac-1.4 too.

comment:14 in reply to:  13 ; Changed 5 years ago by Massimo

Replying to Gasol Wu:

https://github.com/Gasol/trac-xmlrpcplugin/tree/trac-1.5

I was working on this, You can try it, It should be work with Trac-1.4 too.

I tried installing by pip, but failed:

$ pip2 install --user svn+https://github.com/Gasol/trac-xmlrpcplugin.git/trunk
Collecting svn+https://github.com/Gasol/trac-xmlrpcplugin.git/trunk
  Checking out https://github.com/Gasol/trac-xmlrpcplugin.git/trunk to /tmp/pip-req-build-TlVTEk
  Running command svn checkout -q --force-interactive https://github.com/Gasol/trac-xmlrpcplugin.git/trunk /tmp/pip-req-build-TlVTEk
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-TlVTEk/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-TlVTEk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-TlVTEk/pip-egg-info
         cwd: /tmp/pip-req-build-TlVTEk/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-req-build-TlVTEk/setup.py'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Then I've built the egg manually and installed, but /rpc leads to

No handler matched request to /rpc.

My test command from a remote host to test the API is:

curl -s -H "Content-Type: application/xml" --data @- http://TracBot:vGJCp4aT0X@trac/trac-pp/rpc <<< '<?xml version="1.0"?><methodCall><methodName>ticket.get</methodName><params><param><int>11794</int></param></params></methodCall>'

comment:15 in reply to:  14 Changed 5 years ago by Ryan J Ollos

Replying to Massimo:

Replying to Gasol Wu:

https://github.com/Gasol/trac-xmlrpcplugin/tree/trac-1.5

That's a Git repository, so you need to use git+https rather than svn+https.

comment:16 Changed 5 years ago by Massimo

Github provides both git and svn access on the same URL. And because git does not support accessing sub-trees like /trunk I just switched over to svn. I was not able to install from git either.

Though I learned how to set branches in git like https://pip.pypa.io/en/stable/reference/pip_install/#git

comment:17 in reply to:  16 Changed 5 years ago by Gasol Wu

Replying to Massimo:

Github provides both git and svn access on the same URL. And because git does not support accessing sub-trees like /trunk I just switched over to svn. I was not able to install from git either.

Though I learned how to set branches in git like https://pip.pypa.io/en/stable/reference/pip_install/#git

Does it work for you? It's still under development, If you have any issues, feel free to tell me.

comment:18 Changed 5 years ago by Jun Omae

The setup.py is typically located at top directory but it is not in the repository.

If Git is used, it is able to specify the sub directory using #subdirectory=.... Also, it is needed to specify the branch trac-1.5 in @<branch-name>.

$ pip install git+https://github.com/Gasol/trac-xmlrpcplugin.git@trac-1.5#subdirectory=trunk

If Subversion is used, is is able to specify in the URL instead of #subdirectory=....

$ pip install svn+https://github.com/Gasol/trac-xmlrpcplugin/branches/trac-1.5/trunk

It is able to install with a zip file as well.

$ pip install https://github.com/Gasol/trac-xmlrpcplugin/archive/trac-1.5.zip#subdirectory=trunk
Last edited 5 years ago by Jun Omae (previous) (diff)

comment:19 Changed 5 years ago by Massimo

Thanks, I was able to install it now like

pip2 install --user svn+https://github.com/Gasol/trac-xmlrpcplugin/branches/trac-1.5/trunk

... and it seems to work now. Thank you very much. Please integrate and release...

comment:20 Changed 5 years ago by Cauly

Since it's ready to go, why not merge to master, or at least mention the install address in wiki page?

comment:21 Changed 5 years ago by msi

Installing without explicit laying an egg doesn't work for me. Correct install command:

pip install svn+https://github.com/Gasol/trac-xmlrpcplugin/branches/trac-1.5/trunk#egg=TracXMLRPC

comment:22 Changed 4 years ago by Łukasz Matecki

This worked for me for the problem with "cannot import name wiki_to_oneliner"

comment:23 Changed 4 years ago by Cinc-th

In 18172:

XmlRpcPlugin: use Jinja2 template with Trac 1.4. Some tweaks to the templates.

Refs #13611

comment:24 Changed 4 years ago by Cinc-th

In [18171]:

XmlRpcPlugin: fixed installation issues with Trac 1.4. Bumped version to 1.1.10. Note that notifications for ticket creation/changes are disabled for now. Refs #13611


This commit message was lost somehow...

comment:25 Changed 4 years ago by Cinc-th

@rjollos:

the dev tag is not set in setup.cfg. Should I set it?

Note that I (maybe/probably prematurely) already increased the version to 1.1.10 in [18171].

comment:26 in reply to:  25 Changed 4 years ago by Ryan J Ollos

Replying to Cinc-th:

the dev tag is not set in setup.cfg. Should I set it?

Yeah, sounds good.

Note that I (maybe/probably prematurely) already increased the version to 1.1.10 in [18171].

We may want to bump to 1.2.0dev since we are dropping support for older Trac versions and adding support for newer Trac versions.

comment:27 Changed 4 years ago by Cinc-th

Bumped the version to 1.2.dev in [18220].

comment:28 Changed 3 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Cinc-th
Status: acceptedassigned

comment:29 Changed 22 months ago by Jun Omae

Resolution: fixed
Status: assignedclosed

The latest works with Trac 1.4.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Cinc-th.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.