On Nov 18, 2010, at 5:40 PM, Kenneth Lundström wrote:
>
> Thank you Jonathan,
>
> that solved the upgrade problem.
>
> Problem was that I did the 'chown -R apache:web2py *' command in the web2py
> directory but that doesn't include the directory itself. So when Apache tried
> to download the new version of web2py it could not write it to harddisk.
> Sorry for this beginners mistake.
For other readers of this thread: the correct command (run in the web2py
directory) is 'chown -R apache:web2py .' (though the user:group might vary
depending on your environment).
>
> But the problem with creating a new application stays.
>
>
> Kenneth
>
>> On Nov 18, 2010, at 7:03 AM, Kenneth Lundström wrote:
>>> OK, I have no idea if they are related, it was just a thought on my part.
>> Kenneth, in gluon/admin.py you'll find this code:
>>
>> full_url = url + '/examples/static/web2py_%s.zip' % version_type
>> filename = abspath('web2py_%s_downloaded.zip' % version_type)
>> try:
>> file = open(filename,'wb')
>> file.write(urllib.urlopen(full_url).read())
>> file.close()
>> except Exception,e:
>> file.close()
>> return False, e
>> try:
>> unzip(filename, destination, subfolder)
>>
>> Try removing the second file.close() (the one after 'except'), and then try
>> the upgrade again. It won't fix the upgrade, but you should see a more
>> helpful error message saying why the file open failed.
>>
>>
>>>
>>> Kenneth
>>>
>>>> Thanks Kenneth,
>>>>
>>>> the traceback you posted applies to the second problem and I
>>>> understand that. I am scratching my head on why that traceback would
>>>> also apply to the first problem.
>>>>
>>>> Massimo
>>>>
>>>> On Nov 18, 7:09 am, Kenneth Lundström<[email protected]>
>>>> wrote:
>>>>> - unpacked the source package
>>>>> - did a chown apache:web2py on all files
>>>>> - login in to admin
>>>>> - write the name of the new application and press create
>>>>> - get the unable to create application "test"
>>>>>
>>>>> Upgrade problem, the same, but
>>>>> - select upgrade
>>>>> - press YES
>>>>> - get the error ticket
>>>>>
>>>>> I don t know what else to write.
>>>>>
>>>>> Kenneth
>>>>>
>>>>>> I see the problem but I do not understand why you have it. This should
>>>>>> manifest itself when you upgrade, not when you create a new app. Can
>>>>>> you list steps to reproduce the problem?
>>>>>> I am close to fixing it...
>>>>>> On Nov 17, 3:31 pm, Kenneth Lundstr m<[email protected]>
>>>>>> wrote:
>>>>>>> I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
>>>>>>> I m running Linux, Apache and mod_wsgi. Is this too an file permission
>>>>>>> problem. I still can t create a new application with admin. Don t know
>>>>>>> where to start looking for the problem.
>>>>>>> Kenneth
>>>>>>> Version
>>>>>>> web2py Version 1.89.1 (2010-11-12 15:14:36)
>>>>>>> Python Python 2.6.5: /usr/bin/python
>>>>>>> Traceback
>>>>>>> Traceback (most recent call last):
>>>>>>> File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
>>>>>>> exec ccode in environment
>>>>>>> File "/data/domains/web2py/applications/admin/controllers/default.py",
>>>>>>> line 1146, in<module>
>>>>>>> File "/data/domains/web2py/gluon/globals.py", line 96, in<lambda>
>>>>>>> self._caller = lambda f: f()
>>>>>>> File "/data/domains/web2py/applications/admin/controllers/default.py",
>>>>>>> line 200, in upgrade_web2py
>>>>>>> (success, error) = upgrade(request)
>>>>>>> File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
>>>>>>> file.close()
>>>>>>> UnboundLocalError: local variable 'file' referenced before assignment
>>>>>>> Error snapshot help Detailed traceback description
>>>>>>> <type 'exceptions.UnboundLocalError'>(local variable 'file' referenced
>>>>>>> before assignment)
>>
>