Can you show you mods to the welcome please... You may try to remove the auth.wiki() at line 60 of controllers/default.py though we need to understand how to reproduce this error. There maybe a bug in auth.wiki(). Difficult to say without knowing what you did...
Richard On Fri, Jul 8, 2016 at 1:53 PM, Jim Spoerl <jrspo...@gmail.com> wrote: > Thanks, Richard. Nothing was left over from previous work since I > reinstalled the root directory from scratch. the DB is sqlite so we were > starting from an empty DB. So I think the problem must be in the > downloaded source. Is this correct? > > Here is the ticket: > > 24.233.114.172.2016-07-08.12-20-01.5cd46db0-031d-4ca5-abdb-7cadde73bc99 > <type 'exceptions.UnboundLocalError'> local variable 'gid' referenced > before assignmentVersion > web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 > Python Python 2.7.3: /usr/local/bin/uwsgi (prefix: /usr)Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > > Traceback (most recent call last): > File "/var/www/libertymessengerweb2py/gluon/restricted.py", line 227, in > restricted > exec ccode in environment > File > "/var/www/libertymessengerweb2py/applications/wiki/controllers/default.py" > <https://libertymessenger.org/admin/default/edit/wiki/controllers/default.py>, > line 60, in <module> > File "/var/www/libertymessengerweb2py/gluon/globals.py", line 417, in > <lambda> > self._caller = lambda f: f() > File > "/var/www/libertymessengerweb2py/applications/wiki/controllers/default.py" > <https://libertymessenger.org/admin/default/edit/wiki/controllers/default.py>, > line 20, in index > return auth.wiki() > File "/var/www/libertymessengerweb2py/gluon/tools.py", line 4687, in wiki > groups=groups) > File "/var/www/libertymessengerweb2py/gluon/tools.py", line 6454, in > __init__ > auth.add_membership(gid) > UnboundLocalError: local variable 'gid' referenced before assignment > > Error snapshot [image: help] > <https://libertymessenger.org/admin/default/ticket/wiki/24.233.114.172.2016-07-08.12-20-01.5cd46db0-031d-4ca5-abdb-7cadde73bc99#> > > <type 'exceptions.UnboundLocalError'>(local variable 'gid' referenced > before assignment) > > inspect attributes > Frames > > - > > *File /var/www/libertymessengerweb2py/gluon/restricted.py in > restricted at line 227* code arguments variables > - > > *File > /var/www/libertymessengerweb2py/applications/wiki/controllers/default.py in > <module> at line 60* code arguments variables > - > > *File /var/www/libertymessengerweb2py/gluon/globals.py in <lambda> at > line 417* code arguments variables > - > > *File > /var/www/libertymessengerweb2py/applications/wiki/controllers/default.py in > index at line 20* code arguments variables > - > > *File /var/www/libertymessengerweb2py/gluon/tools.py in wiki at line > 4687* code arguments variables > - > > *File /var/www/libertymessengerweb2py/gluon/tools.py in __init__ at > line 6454* code arguments variables > Function argument list > > (self=<gluon.tools.Wiki object>, auth=<gluon.tools.Auth object>, > env=None, render='markmin', manage_permissions=False, force_prefix='', > restrict_search=False, extra={}, menu_groups=None, templates=None, > migrate=True, controller=None, function=None, groups=None) > Code listing > > 6449. > 6450. > 6451. > 6452. > 6453. > 6454. > > 6455. > 6456. > 6457. > 6458. > > group = db.auth_group(role='wiki_editor') > if group: > gid = group.id > else: > db.auth_group.insert(role='wiki_editor') > auth.add_membership(gid) > > > settings.lock_keys = True > > # WIKI ACCESS POLICY > > > Thanks again for help! > > \Jim > > > On Friday, July 8, 2016 at 1:01:56 PM UTC-4, Richard wrote: >> >> gid stand for group id... >> >> I grep the web2py code base you can see where gid is referenced : >> >> tools.py >> 6451: gid = group.id >> 6454: auth.add_membership(gid) >> >> contrib/fpdf/ttfonts.py >> 918: def getHMetric(self, numberOfHMetrics, gid): >> 920: if (gid < numberOfHMetrics): >> 921: self.seek(start+(gid*4)) >> 926: self.seek(start+(numberOfHMetrics*2)+(gid*2)) >> >> contrib/pg8000/core.py >> 2057: curs.execute("select gid FROM pg_prepared_xacts") >> >> contrib/login_methods/ldap_auth.py >> 571: gid = db.auth_group.insert(role=group_to_add, >> description='Generated from LDAP') >> 573: gid = db(db.auth_group.role == >> group_to_add).select(db.auth_group.id).first().id >> 574: db.auth_membership.insert(user_id=db_user_id, >> group_id=gid) >> >> >> We would need more information contain in the traceback in order to help. >> >> When you reinstall did you recreate you database? >> >> I may possible that it get half created or corrupted because your >> previous issue when failling web2py production deployment. >> >> Or you can check that there is not wrongly defined users or >> group/membership. For membership remaining despite group or user being >> deleted... >> >> Good luck! >> >> Richard >> >> >> On Fri, Jul 8, 2016 at 12:27 PM, Jim Spoerl <jrsp...@gmail.com> wrote: >> >>> Well, in the interest of trying out the wiki again, I tried to reinstall >>> web2py from the "source" site download. All went well. I made sure all >>> was well with permissions (www-data on Debian Wheezy) and with the SSL >>> stuff including the admin password file. Also the wsgi handler file was >>> copied into the root. >>> >>> I went to the site in the browser. The Welcome page came up fine. No >>> errors. I clicked on the administration button and it accepted my admin pw >>> fine. I created a new app, modified the default.py to reference the wiki, >>> and went to the wiki with no errors. >>> >>> Next I tried to create a new user (but if I do not and just try to >>> create a page by clicking on the button for that, the same thing happens). >>> When I had entered my info and tried to register that user, I got this >>> internal error: >>> >>> <type 'exceptions.UnboundLocalError'> local variable 'gid' referenced >>> before assignment >>> >>> Once this occurred, I could not go back to even the main Welcome page >>> without the same error. >>> >>> So something serious is broken in the auth area. Can you help me trough >>> this please? >>> >>> By the way, I have tried this as localhost on port 8000 to keep things >>> simple and the same is occurring there as when I come in via my FQDN. >>> >>> Thanks >>> \Jim >>> >>> On Thursday, July 7, 2016 at 8:00:32 AM UTC-4, Anthony wrote: >>>> >>>> But as a shortcut (I am pretty new with python, admittedly), I have >>>>> tried some of the referenced appliances in the repo including, finally, >>>>> outside the repo, Instant Press. It was promising but it simply throws a >>>>> lot of exceptions as you start to use it. It also has not been maintained >>>>> and will not run without a lot of errors on the latest web2py (like KPax2, >>>>> just doesn't run any longer). >>>>> >>>>> None of the CMS-like apps work currently on web2py having not been >>>>> maintained for years. Where is that "backwards compatibility" when you >>>>> need it? >>>>> >>>> >>>> I don't think there is an actively maintained CMS app/framework for >>>> web2py, so you would have to implement the functionality you desire using >>>> the base web2py framework. >>>> >>>> Regarding backwards compatibility, it is hard to say what is going on >>>> without seeing any of the errors. In some cases, it is possible that the >>>> original code relied on experimental features or undocumented behavior >>>> rather than the public API (only the public API is guaranteed to remain >>>> backward compatible). If there are legitimate cases of backward >>>> compatibility violations, they will likely be addressed, so feel free to >>>> report any you encounter. >>>> >>>> Anthony >>>> >>> -- >>> Resources: >>> - http://web2py.com >>> - http://web2py.com/book (Documentation) >>> - http://github.com/web2py/web2py (Source code) >>> - https://code.google.com/p/web2py/issues/list (Report Issues) >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "web2py-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to web2py+un...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.