[tahoe-lafs-trac-stream] [tahoe-lafs] #1159: stop using .tac files: make it possible to change appname, Python package-directory name, perhaps other names

tahoe-lafs trac at tahoe-lafs.org
Thu Jan 3 16:23:57 UTC 2013


#1159: stop using .tac files: make it possible to change appname, Python package-
directory name, perhaps other names
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:  davidsarah
  davidsarah             |     Status:  assigned
         Type:  defect   |  Milestone:  1.10.0
     Priority:  major    |    Version:  1.8β
    Component:  code-    |   Keywords:  test-needed backward-compatibility
  nodeadmin              |  forward-compatibility appname tac needs-spawn
   Resolution:           |  packaging setuptools review-needed
Launchpad Bug:           |
-------------------------+-------------------------------------------------

Old description:

> ([http://tahoe-lafs.org/pipermail/tahoe-dev/2010-August/004903.html
> Reported to tahoe-dev] by Nathan Eisenberg.)
>
> In the 1.8beta release, when a user attempts to start a node using a node
> directory generated by an earlier version (or trunk), it will fail to
> start and will report a traceback similar to:
> {{{
> ~/tahoe-lafs-ticket798-1.7.1-r4653/bin# ./tahoe start
> STARTING '/root/.tahoe'
> Traceback (most recent call last):
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/application/app.py", line 626, in run
>     runApp(config)
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/scripts/twistd.py", line 23, in runApp
>     _SomeApplicationRunner(config).run()
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/application/app.py", line 374, in run
>     self.application = self.createOrGetApplication()
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/application/app.py", line 439, in
> createOrGetApplication
>     application = getApplication(self.config, passphrase)
> --- <exception caught here> ---
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/application/app.py", line 450, in
> getApplication
>     application = service.loadApplication(filename, style, passphrase)
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/application/service.py", line 390, in
> loadApplication
>     application = sob.loadValueFromFile(filename, 'application',
> passphrase)
>   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5
> -linux-x86_64.egg/twisted/persisted/sob.py", line 210, in
> loadValueFromFile
>     exec fileObj in d, d
>   File "tahoe-client.tac", line 5, in <module>
>     pkg_resources.require('allmydata-tahoe')
>   File "/root/tahoe-lafs-
> ticket798-1.7.1-r4653/setuptools-0.6c16dev.egg/pkg_resources.py", line
> 666, in require
>     needed = self.resolve(parse_requirements(requirements))
>   File "/root/tahoe-lafs-
> ticket798-1.7.1-r4653/setuptools-0.6c16dev.egg/pkg_resources.py", line
> 565, in resolve
>     raise DistributionNotFound(req)  # XXX put more info here
> pkg_resources.DistributionNotFound: allmydata-tahoe
> }}}
>
> This happens because the appname was changed to "{{{tahoe-lafs-
> ticket798}}}" for the beta [4595/ticket798], but existing {{{.tac}}}
> files contain references to the previous "{{{allmydata-tahoe}}}" appname.
> For example, {{{tahoe-client.tac}}} typically contains:
> {{{
> # -*- python -*-
>
> import pkg_resources
> pkg_resources.require('allmydata-tahoe')
> pkg_resources.require('twisted')
> from allmydata import client
> from twisted.application import service
>
> c = client.Client()
>
> application = service.Application("allmydata_client")
> c.setServiceParent(application)
> }}}
>
> Note that the appname change [source:setup.py at 4668#L329 has not been made
> on trunk], only on the ticket798 branch from which the beta was built.
>
> We should therefore withdraw the beta, because otherwise users may
> generate new node directories that will not work in future versions (due
> to the opposite problem, i.e. {{{DistributionNotFound: tahoe-lafs-
> ticket798}}}).
>
> This failed to be detected because there are no tests that check
> compatibility with a node directory generated by a previous version. To
> prevent this happening again, we need the test suite to run at least a
> smoke test with a node directory that looks like one generated by an
> earlier version (perhaps check one in as a resource, with a big-fat-
> warning not to change it).

New description:

 ([http://tahoe-lafs.org/pipermail/tahoe-dev/2010-August/004903.html
 Reported to tahoe-dev] by Nathan Eisenberg.)

 In the 1.8beta release, when a user attempts to start a node using a node
 directory generated by an earlier version (or trunk), it will fail to
 start and will report a traceback similar to:
 {{{
 ~/tahoe-lafs-ticket798-1.7.1-r4653/bin# ./tahoe start
 STARTING '/root/.tahoe'
 Traceback (most recent call last):
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/application/app.py", line 626, in run
     runApp(config)
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/scripts/twistd.py", line 23, in runApp
     _SomeApplicationRunner(config).run()
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/application/app.py", line 374, in run
     self.application = self.createOrGetApplication()
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/application/app.py", line 439, in
 createOrGetApplication
     application = getApplication(self.config, passphrase)
 --- <exception caught here> ---
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/application/app.py", line 450, in getApplication
     application = service.loadApplication(filename, style, passphrase)
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/application/service.py", line 390, in loadApplication
     application = sob.loadValueFromFile(filename, 'application',
 passphrase)
   File "/root/tahoe-lafs-ticket798-1.7.1-r4653/Twisted-10.1.0-py2.5-linux-
 x86_64.egg/twisted/persisted/sob.py", line 210, in loadValueFromFile
     exec fileObj in d, d
   File "tahoe-client.tac", line 5, in <module>
     pkg_resources.require('allmydata-tahoe')
   File "/root/tahoe-lafs-
 ticket798-1.7.1-r4653/setuptools-0.6c16dev.egg/pkg_resources.py", line
 666, in require
     needed = self.resolve(parse_requirements(requirements))
   File "/root/tahoe-lafs-
 ticket798-1.7.1-r4653/setuptools-0.6c16dev.egg/pkg_resources.py", line
 565, in resolve
     raise DistributionNotFound(req)  # XXX put more info here
 pkg_resources.DistributionNotFound: allmydata-tahoe
 }}}

 This happens because the appname was changed to "{{{tahoe-lafs-
 ticket798}}}" for the beta [4595/ticket798], but existing {{{.tac}}} files
 contain references to the previous "{{{allmydata-tahoe}}}" appname. For
 example, {{{tahoe-client.tac}}} typically contains:
 {{{
 # -*- python -*-

 import pkg_resources
 pkg_resources.require('allmydata-tahoe')
 pkg_resources.require('twisted')
 from allmydata import client
 from twisted.application import service

 c = client.Client()

 application = service.Application("allmydata_client")
 c.setServiceParent(application)
 }}}

 Note that the appname change [source:setup.py at 4668#L329 has not been made
 on trunk], only on the ticket798 branch from which the beta was built.

 We should therefore withdraw the beta, because otherwise users may
 generate new node directories that will not work in future versions (due
 to the opposite problem, i.e. {{{DistributionNotFound: tahoe-lafs-
 ticket798}}}).

 This failed to be detected because there are no tests that check
 compatibility with a node directory generated by a previous version. To
 prevent this happening again, we need the test suite to run at least a
 smoke test with a node directory that looks like one generated by an
 earlier version (perhaps check one in as a resource, with a big-fat-
 warning not to change it).

--

Comment (by davidsarah):

 Starting review.

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1159#comment:29>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list