collective / collective.nitf

A Dexterity-based content type inspired on the News Industry Text Format specification
8 stars 3 forks source link

Problem on upgrade collective.nitf 1.0b7 #186

Closed makelli closed 7 years ago

makelli commented 7 years ago

Error executing upgrade steps above:

Upgrade Step Group -> Fix filter for Urgency field Fix Collection filter for Urgency field. (1007 → 1008)
-> Update existent collections Update existent collections with fixed Urgency field. (1007 → 1008)

Message:

Module ZPublisher.Publish, line 138, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 48, in call_object Module Products.GenericSetup.tool, line 1034, in manage_doUpgrades Module Products.GenericSetup.upgrade, line 166, in doStep Module collective.nitf.upgrades.v1008, line 17, in fix_collections TypeError: 'NoneType' object is not iterable

hvelarde commented 7 years ago

I think this was fixed in collective.nitf 1.0b8: https://github.com/collective/collective.nitf/blob/1.0b8/src/collective/nitf/upgrades/v1008/__init__.py#L22-L25

do you mind to give it a try?

idgserpro commented 7 years ago

How should @makelli give a try? Backup collective/nitf/upgrades/v1008/__init__.py, take this init.py, overriding her collective/nitf/upgrades/v1008/__init__.py, run the upgradeStep and then return with the backup?

I think she is trying to run it in brasil.gov.portal from plonegovbr, she can't upgrade collective.nitf since it's pinned in https://github.com/plonegovbr/portalpadrao.release/blob/master/1.1.5.2/versions.cfg#L37

hvelarde commented 7 years ago

overriding the file sound good to me; I always do such kind of things (even in production) to test code; there's no need to go back to the old file after running the upgrade step.

makelli commented 7 years ago

I do the overriding and run the upgradeStep , but :

Traceback (innermost last): Module ZPublisher.Publish, line 138, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 48, in call_object Module Products.GenericSetup.tool, line 1034, in manage_doUpgrades Module Products.GenericSetup.upgrade, line 166, in doStep Module collective.nitf.upgrades.v1008, line 28, in fix_collections TypeError: 'NoneType' object is not iterable

On Wed, Jan 25, 2017 at 3:16 PM, Héctor Velarde notifications@github.com wrote:

yes overriding the file sound good to me; I always do such kind of things (even in production) to test code.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/collective/collective.nitf/issues/186#issuecomment-275187905, or mute the thread https://github.com/notifications/unsubscribe-auth/AH_L2Y8Qe9pqUkSGc0spgxzqC1K-Xlyeks5rV5FkgaJpZM4LsiU5 .

idgserpro commented 7 years ago

@makelli, before the line:

for item in query:

please add

print col
print obj

So you can try to find what is making your upgradeStep fail. We suggest debugging this way and, if you don't have too much files giving you this problem and you don't know what is the cause of the bug, you can try deleting and recreating the problematic files (this is the last resource though).

idgserpro commented 7 years ago

@makelli It would ne useful as well if you post here information about this file that is returning 'None' when getQuery is invoked, maybe the code here can be improved.

hvelarde commented 7 years ago

seems to me you have a collection with no query defined on it; add the following below line 26:

if query is None:
    continue

and let me know the results.

makelli commented 7 years ago

Its works.thank you so much for your help. Apparently, the problem was the collection if no results. I did the print obj like you said.

On Wed, Jan 25, 2017 at 6:50 PM, Héctor Velarde notifications@github.com wrote:

seems to me you have a collection with no query defined on it; add the following below line 26:

if query is None: continue

and let me know the results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/collective/collective.nitf/issues/186#issuecomment-275243909, or mute the thread https://github.com/notifications/unsubscribe-auth/AH_L2c0Lneof64ET2eyXES7oOBQmj6j3ks5rV8O7gaJpZM4LsiU5 .

idgserpro commented 7 years ago

seems to me you have a collection with no query defined on it

Should the upgadeStep handle this as well or can we close the issue?

makelli commented 7 years ago

you can close the issue!

On Thu, Jan 26, 2017 at 8:54 AM, idgserpro notifications@github.com wrote:

seems to me you have a collection with no query defined on it

Should the upgadeStep handle this as well or can we close the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/collective/collective.nitf/issues/186#issuecomment-275371472, or mute the thread https://github.com/notifications/unsubscribe-auth/AH_L2a3QOs4W9cd0jt9XTY9i4xR4P8-bks5rWImPgaJpZM4LsiU5 .

hvelarde commented 7 years ago

not until fixed in the branch.

idgserpro commented 7 years ago

https://github.com/collective/collective.nitf/pull/187