Adding collective.deletepermission to Plone 4.3.17

Hello,

i am running Plone 4.3.17 and Python 2.7. I would like to enable users to delete their own created content objects. Therefore, I identified a solution: the "collective.deletepermission" package.

I added the package to the "eggs" section of my buildout.cfg as follows:

eggs =
    Plone
    Pillow
    collective.deletepermission

Then I tried to run .\bin\buildout with the follwing error:

Installing instance.
/home/myuser/Plone/buildout-cache/eggs/setuptools-27.3.0-py2.7.egg/pkg_resources/__init__.py:188: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
Download error on http://download.zope.org/ppix/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Download error on http://download.zope.org/distribution/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
Getting distribution for 'collective.deletepermission'.
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
While:
  Installing instance.
  Getting distribution for 'collective.deletepermission'.
Error: Couldn't find a distribution for 'collective.deletepermission'.

Any help is much appreciated!

Thanks

Does your buildout.cfg contain index = https://pypi.python.org/simple in the buildout section? Since some time, pypi requires https which must be chosen via the definition above for older buildout/setuptools versions.

Hi Dieter,

thank you very much for your suggestion. I added the suggested line right at the beginning of the buildout section like follows:

[buildout]

index = https://pypi.python.org/simple

...

Unfortunately, I do receive the exact same error.

Any further thoughts, what the reason / solution may be?

Thank you!

You could run buildout with increased verbosity (e.g. with option -vvv). This may give hints.

Try adding another add-on instead in buildout.cfg, and see if the error is still the same.

If you still have the error, maybe you could paste buildout.cfg (remove the 'personal lines' (admin, password etc)

Hi Dieter,
I ran buildout with option -vvv
The beginning looks fine, a lot of packages are listed with their version number. The end section looks like this:

[zopepy]
_b = /home/user/Plone/zinstance/bin
_d = /home/user/Plone/zinstance/develop-eggs
_e = /home/user/Plone/buildout-cache/eggs
bin-directory = /home/user/Plone/zinstance/bin
develop-eggs-directory = /home/user/Plone/zinstance/develop-eggs
eggs = Plone
Pillow
collective.deletepermission
eggs-directory = /home/user/Plone/buildout-cache/eggs
executable = /home/user/Plone/Python-2.7/bin/python
find-links = http://dist.plone.org
http://download.zope.org/ppix/
http://download.zope.org/distribution/
http://dist.plone.org/release/4.3.17
index = https://pypi.python.org/simple
interpreter = zopepy
python = buildout
recipe = zc.recipe.egg
scripts = zopepy

Installing instance.
/home/user/Plone/buildout-cache/eggs/setuptools-27.3.0-py2.7.egg/pkg_resources/init.py:188: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
stacklevel=1,
Installing 'Plone', 'Pillow', 'collective.deletepermission', 'plone.recipe.zope2instance'.
We have the distribution that satisfies 'Plone==4.3.17'.
We have the distribution that satisfies 'Pillow==5.1.0'.
We have no distributions for collective.deletepermission that satisfies 'collective.deletepermission'.
Download error on http://download.zope.org/ppix/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Download error on http://download.zope.org/distribution/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
Getting distribution for 'collective.deletepermission'.
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
While:
Installing instance.
Getting distribution for 'collective.deletepermission'.
Error: Couldn't find a distribution for 'collective.deletepermission'.

Hi,

here is my entire buildout.cfg (comments removed).
I replaced hastags with another notation /* ... */, as hashtags seem to trigger some kind of markup in the forum.

[buildout]

index = https://pypi.python.org/simple

extends =
base.cfg
versions.cfg
/* http://dist.plone.org/release/4.3.17/versions.cfg */

find-links +=
http://dist.plone.org/release/4.3.17

effective-user = user
buildout-user = user
need-sudo = no

eggs =
Plone
Pillow
collective.deletepermission

zcml =
/* plone.reload */

develop =
/ *src/my.package */

var-dir=${buildout:directory}/var

backups-dir=${buildout:var-dir}

user=admin:xyz

deprecation-warnings = off
verbose-security = off

parts =
instance
repozo
backup
zopepy
unifiedinstaller

[instance]
<= instance_base
recipe = plone.recipe.zope2instance
http-address = 8080

[versions]
zc.buildout = 2.5.3
setuptools = 27.3.0
Pillow = 5.1.0

buildout.sanitycheck = 1.0.2
collective.recipe.backup = 4.0
plone.recipe.unifiedinstaller = 4.3.2

Can a possible solution be just to run buildout with newer versions of zc.buildout and setuptools?
If yes, which most recent versions can you recommend, which can build Plone 4.3.17 on Python 2.7?

If this works, can I simply change the version numbers in the [versions] section of buildout.cfg, or do I have to adjust more stuff in versions.cfg?

Thanks

It looks correct to me. Could you try to add something else to your buildout to see if that is working ( for example collective.easyform )


Yes # is for markup (or actually markdown), so # Title1 and ## Title2 looks like

Title1

Title2

collective.deletepermission is on PyPI. Thus, something seems to be wrong with PyPI access.

A client is using Python 2.7.17, setuptools==38.5.1, zc.buildout==2.13.1 with Plone 4. You must defne the new version numbers for setuptools and zc.buildout in the versions section of your buildout configuration but this is not sufficient. How to upgrade setuptools and zc.buildout was discussed in the forum (you could search for this). The client mentioned above did something like: create a new virtual env with the new Python version; install the correct setuptools and zc.buildout versions in this virtual env. Use the zc.buildout in the virtual env to initialize the Plone installation (with will create bin/buildout); run bin/buildout.

Not sure that this will resolve your current problem.

Hi espenmn,

unfortunately with "collective.easyform" I get the same errors.

This means that there is something 'general' wrong.
Read Dieters answer, and check that you actually have internet connection on that server/machine.

Hi espenmn,

I do have internet connection on the machine. I have no problem updating packages on generell with "apt-get" or with "pip". That is not the issue.

I did find a similar issue on the forum:

This post claims, that I need at least zc.buildout version 2.9.5 or above?
Am I interpreting those post correctly?

Thanks

I don't think that is your problem (I have not read all, so I can't be sure, though).

Most of these problems had to do with PyPi changing to https, so every buildout had to change too https. this is the line:

index = https://pypi.python.org/simple 

What happens if you download a new 'universal installer', install that, and see what happens.

Hi espenmn, Dieter,

I did get the latest unified installer I could find (4.3.19) and installed a fresh Plone with it. It displays the same error. I am running Ubuntu 18.04, so unless there is a general problem with Ubuntu and Plone I assume that this is a general bug of Plone 4 installers and adding the line "index = https://pypi.python.org/simple" does not fix the problem.

I also saw that there is an even newer version (4.3.20), however I could not find an universal installer for that. May that version fix the problem?

Is there anyone still supporting Plone 4.3.x who could verify the issue?
Can you point me in any other direction?
Can I manually download and add the egg to my buildout?

Thank you for any further advice!

There is no problem with Ubuntu 18.04 (the formerly mentioned client uses it).Plone 4 is now quite old: it is well possible that its installers have not been updated to new setuptools/zc.buildout versions.

At your place, I would try the setuptools/zc.buildout upgrade.

Hi Dieter,

I already tried that:

  • upgraded zc.buildout -> 2.13.1
  • upgraded zc.buildout -> 44.1.1

pip show zc.buildout:

Name: zc.buildout
Version: 2.13.1
Summary: System for managing development buildouts
Home-page: http://buildout.org
Author: Jim Fulton
Author-email: jim@zope.com
License: ZPL 2.1
Location: /home/user/Plone/Python-2.7/lib/python2.7/site-packages
Requires: setuptools
Required-by:

pip show setuptools:

Name: setuptools
Version: 44.1.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: GitHub - pypa/setuptools: Official project repository for the Setuptools build system
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: /home/user/Plone/Python-2.7/lib/python2.7/site-packages
Requires:
Required-by: zc.buildout

Updated the versions-section of my buildout.cfg to:

[versions]
zc.buildout = 2.13.1
setuptools = 44.1.1
Pillow = 5.1.0

Also added the "index" line again:

[buildout]

index = https://pypi.python.org/simple

Running /bin/buildout still delivers an error message:
Installing instance.
Download error on http://download.zope.org/ppix/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Download error on http://download.zope.org/distribution/: hostname 'download.zope.org' doesn't match 'vm06.plyp.com' -- Some packages may not be found!
Download error on https://pypi.python.org/simple/collective.deletepermission/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
Getting distribution for 'collective.deletepermission'.
Couldn't find index page for 'collective.deletepermission' (maybe misspelled?)
While:
Installing instance.
Getting distribution for 'collective.deletepermission'.
Error: Couldn't find a distribution for 'collective.deletepermission'.

Interestingly if I enter the URL Links for collective.deletepermission in a browser on the same machine I do get access.

How new is your Python?
When I remember right, PyPI access now requires SNI (= "Server Name Information" or something similar) support. Python must not be too old to provide this. Check from urllib import urlopen; urlopen("https://pypi.org/simple/collective-deletepermission/").

1 Like

Hi Dieter,

my python is 2.7.17 and the result of your code is:

Python 2.7.17 (default, Sep 30 2020, 13:38:04)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from urllib import urlopen;
urlopen("Links for collective-deletepermission")
<addinfourl at 140427096804320 whose fp = <socket._fileobject object at 0x7fb7bb3bd8d0>>

just a quick question: do you have any allow-hosts configuration option in your buildout ... you can do a bin/buildout annotate to expose all config options and where they are configured and check if there is a host constrain for downloading packages ...