[web2py] Re: Why is scheduler creating so many files at /var/spool/postfix/maildrop?
On Thursday, August 9, 2018 at 3:56:33 PM UTC-7, Lisandro wrote: > > I've found that my production server has a lot of files in > /var/spool/postfix/maildrop. > I don't use postfix at all, however that folder is full of files. > All the files follow the same name format, like > this: 2B8431690D, 5712AE68F, 73CF062660, 73C02183A9, 5706512838, 2B7E413705. > > The file content appears to be encoded, but using nano I can see they all > have something very similar, like this: > > T^Q1533305867 356761A^Urewrite_context=localF > CronDaemonS^EnginxM^@N^]From: "(Cron Daemon)" N To: > nginxN]Subject: Cron python /var/www/medios/web2py.py -K > webmedios # web2py schedulerN'Content-Type: text/plain; > charset=UTF-8N^^Auto-Submitted: auto-generatedN^PPrecedence: > bulkN#X-Cron-Env: N+X-Cron-Env: > N^]X-Cron-Env: > N^[X-Cron-Env: > N!X-Cron-Env: N X-Cron-Env: > N^[X-Cron-Env: N^XX-Cron-Env: > N^@N^Tweb2py Web FrameworkN1Created by Massimo Di Pierro, > Copyright 2007-2018N3Version > 2.16.1-stable+timestamp.2017.11.14.05.54.25NGDatabase drivers available: > sqlite3, psycopg2, pg8000, pymysql, imaplibN,starting single-scheduler for > "webmedios"...X^@R^EnginxE^@ > > > Notice this line: > python /var/www/medios/web2py.py -K webmedios > > > I'm using the system's cron (with the "nginx" user) to run the scheduler, > so I guess these files are being created each time the scheduler is run. > Is there a way to avoid those files being created? Or is it something I > would have to solve at OS level? > > Thanks in advance! > It looks like it has nothing to do with the scheduler and everything to do with the cron daemon. Notice this line: > From: "(Cron Daemon)" How often are they being created? The scheduler generally only needs to be started once per boot. /dps -- 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.
Re: [web2py] Re: web2py broken
here is my menu.py: # -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations # ## Customize your APP title, subtitle and menus here # response.title = ' '.join(word.capitalize() for word in request.application. split('_')) response.subtitle = T('customize me!') ## read more at http://dev.w3.org/html5/markup/meta.name.html response.meta.author = 'xxx' response.meta.description = 'xxx' response.meta.keywords = 'xxx' response.meta.generator = 'Web2py Web Framework' #response.meta.copyright = 'Copyright 2012-'+str(datetime.datetime.now().year) ## your http://google.com/analytics id response.google_analytics_id = "xxx" # ## this is the main application menu add/remove items as required # response.menu = [ ('', False,A('START',_href=URL('default','index'),_title="Zurück zur Startseite"), []), ('', False,A('ARTIKEL', _href=URL('default','Articles'), _title="Liste aller Artikel"), []), ('', False,A('FILME', _href=URL('default','Movies'),_title="Liste aller Filme"), []), ('', False,A('KRITIKEN', _href=URL('default','Reviews'), _title="Liste aller Kritiken"), []) ] # ## provide shortcuts for development. remove in production # def _(): # shortcuts app = request.application ctr = request.controller # useful links to internal and external resources response.menu+=[ (SPAN('INFOS',_style='color:white'),False, None, [ ('',False,A('Impressum', _href=URL(r=request,c='default' ,f='Impressum'), _title="Informationen zu Movie-Alarm, Haftungsausschluss" )), ('',False,A('Partnerschaft', _href=URL(r=request,c= 'default',f='Partner'), _title="Unsere Partnerseiten /Partner werden")), ('',False,A('Unterstütze MovieAlarm', _href=URL(r= request,c='default',f='SupportMovieAlarm'), _title="Informationen wie du dafür sorgen kannst das wir weiterhin gute inhalte für dich erstellen.")) ] ) ] #--Require Authorization- if auth.has_membership('Author'): response.menu+=[ (SPAN('AUTOREN',_style='color:yellow'),False, None, [ (T('Unfinished'),False,URL(r=request,c='author',f= 'unfinished')), (T('Neuen Artikel Anlegen'),False,URL(r=request,c= 'author',f='newArticle')), (T('Neues Review Schreiben'),False,URL(r=request,c= 'author',f='newReview')), (T('Neuen Film Anlegen'),False,URL(r=request,c='author', f='newMovie')), (T('Neues Bild'),False,URL(r=request,c='author',f= 'newImage')), (T('Hilfe für Autoren'),False,URL(r=request,c='manage',f ='Manuals')), (T('Anleitung Schreiben'),False,URL(r=request,c='manage' ,f='WriteManual')), (T('§ Infos zu Medien §'),False,URL(r=request,c='author' ,f='RInfos')) ] ) ] _() @anthony: I will look up how to connect to sqlite in python dbs and try it @stifan: I am not sure what the problem is. I will keep your solution in mind and try it tomorrow. -- 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.
Re: [web2py] Re: web2py broken
if you sure the problem is with database sqlite file and your data is not corrupted (integrity checked database = OK) just an idea why not extract your data and put it on new database (sqlite or another dbms (recommended using export_to_csv_file() and import_from_csv_file() ) *# backup database* sqlite3 ~/web2py/applications/app/databases/app.sqlite .dump > ~/app.bak *# restore database* mv ~/web2py/applications/app/databases/app.sqlite ~/web2py/applications/app/databases/app.sqlite.old sqlite3 ~/web2py/applications/app/databases/app.sqlite < ~/app.bak another way is using web2py export_to_csv_file() then import_from_csv_file() *ref:* http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data best regards, stifan -- 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.
Re: [web2py] Re: web2py broken
Are you able to connect to the database (either the one on your server or the copy you have downloaded to your machine) via a Python shell using https://docs.python.org/2/library/sqlite3.html (i.e., no web2py or DAL)? Anthony On Friday, August 10, 2018 at 11:00:43 AM UTC-4, BlueShadow wrote: > > Hi thanks for all the answers. > Just before I got your answers I found this article: > https://www.team-mediaportal.com/wiki/display/MediaPortal1/Repair+SQLite+Database > > which i followed to check the integrety of my database. and it says *OK* > @stifan: it is the last server backup. the last manual backup i did was in > 2016. (and I changed quite a bit since that time. > my db.py looks like this: > # -*- coding: utf-8 -*- > > # > ## This scaffolding model makes your app work on Google App Engine too > ## File is released under public domain and you can use without limitations > # > > ## if SSL/HTTPS is properly configured and you want all HTTP requests to > ## be redirected to HTTPS, uncomment the line below: > # request.requires_https() > import datetime > import os > from plugin_multiselect_widget import ( > hmultiselect_widget, vmultiselect_widget, > rhmultiselect_widget, rvmultiselect_widget, > ) > > #if not request.env.web2py_runtime_gae: > ## if NOT running on Google App Engine use SQLite or other DB > db = DAL('sqlite://storage.sqlite', migrate=False,lazy_tables=True) > try: > db.executesql("PRAGMA journal_mode=WAL;") > except: > pass > > response.generic_patterns = ['*'] if request.is_local else [] > > > > > > auth = Auth(db, hmac_key="I am not sharing the key") > #crud, service, plugins = Crud(db), Service(), PluginManager() > > ## append auth tables > auth.settings.extra_fields['auth_user']= [ > Field('username', unique=True,requires=IS_NOT_IN_DB(db, > 'auth_user.username')), > Field('address'), > Field('country','reference Land'), > Field('city'), > Field('zip'), > Field('favouritemovie'), > Field('birthday','date',requires=IS_DATE()), > Field('sex','reference Sex'), > Field('phone'), > Field('registration_date','datetime',default=datetime.datetime.now(), > writable=False,readable=False), > Field('newsletter','reference Newsletter') > ] > auth.settings.password_min_length = 5 > auth.settings.registration_requires_verification = True > > ## create all tables needed by auth if not custom tables > > db.define_table('Sex', > Field('Name'), > format = '%(Name)s' > ) > > db.define_table('Land', > Field('Name'), > format = '%(Name)s' > ) > """f = open('countries.txt', 'r')#for some weird reason > this does not work. > countries=f.readlines() > for c in countries: > db.Land.update_or_insert(Name=c) > > f.close()""" > db.define_table('Newsletter', > Field('Name'), > format = '%(Name)s' > ) > auth.define_tables(username=True, migrate=False) > > ## configure email > mail=auth.settings.mailer > mail.settings.server = 'logging' or 'smtp.gmail.com:587' > mail.settings.sender = 'y...@gmail.com' > mail.settings.login = 'username:password' > > ## configure auth policy > auth.settings.registration_requires_verification = False > auth.settings.registration_requires_approval = False > auth.settings.reset_password_requires_verification = True > > ## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc. > ## register with janrain.com, write your domain:api_key in > private/janrain.key > from gluon.contrib.login_methods.rpx_account import use_janrain > use_janrain(auth,filename='private/janrain.key') > > > db.define_table('myerror', > Field('Time','datetime',default=datetime.datetime.now()), > Field('code','integer'), > Field('request_URL'), > Field('client'), > Field('useragent'), > ) > > > db.define_table('Sort', > Field('Name'), > format = '%(Name)s' > ) > db.Sort.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'Sort.Name')] > > > db.define_table('Genre', > Field('Name'), > format = '%(Name)s' > ) > db.Genre.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'Genre.Name')] > > db.define_table('Category', > Field('Name'), > format = '%(Name)s' > ) > db.Category.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, > 'Category.Name')] > > > db.Land.Name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'Land.Name')] > > > > db.define_table('Quelle', > Field('Name',length=512), > Field('Copyrightline',length=512), > Field('URL',length=512), > Field('Nutzungsbedingungen','text') > ) > > > db.define_table('Images', > Field('Bildunterschrift'
Re: [web2py] Re: web2py broken
What about menu.py? Can we see that? -Jim On Friday, August 10, 2018 at 10:00:43 AM UTC-5, BlueShadow wrote: > > Hi thanks for all the answers. > Just before I got your answers I found this article: > https://www.team-mediaportal.com/wiki/display/MediaPortal1/Repair+SQLite+Database > > which i followed to check the integrety of my database. and it says *OK* > @stifan: it is the last server backup. the last manual backup i did was in > 2016. (and I changed quite a bit since that time. > my db.py looks like this: > # -*- coding: utf-8 -*- > > # > ## This scaffolding model makes your app work on Google App Engine too > ## File is released under public domain and you can use without limitations > # > > ## if SSL/HTTPS is properly configured and you want all HTTP requests to > ## be redirected to HTTPS, uncomment the line below: > # request.requires_https() > import datetime > import os > from plugin_multiselect_widget import ( > hmultiselect_widget, vmultiselect_widget, > rhmultiselect_widget, rvmultiselect_widget, > ) > > #if not request.env.web2py_runtime_gae: > ## if NOT running on Google App Engine use SQLite or other DB > db = DAL('sqlite://storage.sqlite', migrate=False,lazy_tables=True) > try: > db.executesql("PRAGMA journal_mode=WAL;") > except: > pass > > response.generic_patterns = ['*'] if request.is_local else [] > > > > > > auth = Auth(db, hmac_key="I am not sharing the key") > #crud, service, plugins = Crud(db), Service(), PluginManager() > > ## append auth tables > auth.settings.extra_fields['auth_user']= [ > Field('username', unique=True,requires=IS_NOT_IN_DB(db, > 'auth_user.username')), > Field('address'), > Field('country','reference Land'), > Field('city'), > Field('zip'), > Field('favouritemovie'), > Field('birthday','date',requires=IS_DATE()), > Field('sex','reference Sex'), > Field('phone'), > Field('registration_date','datetime',default=datetime.datetime.now(), > writable=False,readable=False), > Field('newsletter','reference Newsletter') > ] > auth.settings.password_min_length = 5 > auth.settings.registration_requires_verification = True > > ## create all tables needed by auth if not custom tables > > db.define_table('Sex', > Field('Name'), > format = '%(Name)s' > ) > > db.define_table('Land', > Field('Name'), > format = '%(Name)s' > ) > """f = open('countries.txt', 'r')#for some weird reason > this does not work. > countries=f.readlines() > for c in countries: > db.Land.update_or_insert(Name=c) > > f.close()""" > db.define_table('Newsletter', > Field('Name'), > format = '%(Name)s' > ) > auth.define_tables(username=True, migrate=False) > > ## configure email > mail=auth.settings.mailer > mail.settings.server = 'logging' or 'smtp.gmail.com:587' > mail.settings.sender = 'y...@gmail.com ' > mail.settings.login = 'username:password' > > ## configure auth policy > auth.settings.registration_requires_verification = False > auth.settings.registration_requires_approval = False > auth.settings.reset_password_requires_verification = True > > ## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc. > ## register with janrain.com, write your domain:api_key in > private/janrain.key > from gluon.contrib.login_methods.rpx_account import use_janrain > use_janrain(auth,filename='private/janrain.key') > > > db.define_table('myerror', > Field('Time','datetime',default=datetime.datetime.now()), > Field('code','integer'), > Field('request_URL'), > Field('client'), > Field('useragent'), > ) > > > db.define_table('Sort', > Field('Name'), > format = '%(Name)s' > ) > db.Sort.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'Sort.Name')] > > > db.define_table('Genre', > Field('Name'), > format = '%(Name)s' > ) > db.Genre.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'Genre.Name')] > > db.define_table('Category', > Field('Name'), > format = '%(Name)s' > ) > db.Category.Name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, > 'Category.Name')] > > > db.Land.Name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'Land.Name')] > > > > db.define_table('Quelle', > Field('Name',length=512), > Field('Copyrightline',length=512), > Field('URL',length=512), > Field('Nutzungsbedingungen','text') > ) > > > db.define_table('Images', > Field('Bildunterschrift',length=1024), > Field('Image','upload',uploadfolder=os.path.join(request.folder, > 'uploads/')), > Field('thumb','upload',writable=False,readable=False,uploadfolder=os. > path.
[web2py] Re: Virtual Method/Field with None value
Hello!! I did more tests and you're right. It works well when returning null values Thanks El viernes, 3 de agosto de 2018, 20:08:53 (UTC-3), Anthony escribió: > > On Friday, August 3, 2018 at 4:23:05 PM UTC-4, fiubarc wrote: >> >> Hi, im getting AttributeError if the value returned by a virtual method >> is none.. >> >> There is some way to get the none value or i always have to check >> ['virtualfield'] is in db.table >> > > I believe the virtual field should be in the Row if it returns a value > (even if the value is None), but it will not be present in the Row if the > virtual field function throws an exception because some of the fields it > needs are missing. Are you sure all the necessary fields are present and > the function is not generating an AttributeError or KeyError exception? > > 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: web2py broken
Although I don't really use SQLite, I just noticed that I have "SQLite2009 Pro Enterprise Manager" on my Windows PC. For a better list of tools, try the SQLite website: https://www.sqlite.org/cvstrac/wiki?p=ManagementTools -- 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.
[web2py] Re: web2py broken
you said your last backup is not work, is it on web2py app backup (*.py, etc) or database backup (something.sqlite or *.csv or *.sql) ? did you do incremental backup? if yes pls restore it one by one (date descending) to verify which one is work and the rest is same like the other's suggestion: - pls open sqlite database with the management tools - or change the database to another (export_to_csv sqlite database then import_to_csv to another database) best regards, stifan -- 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.
Re: [web2py] Re: web2py broken
How much of your app/data can you share with us? What does db.py look like? -Jim On Friday, August 10, 2018 at 7:32:05 AM UTC-5, BlueShadow wrote: > > Hi thanks for the post villas. > I have the database on my local pc. (storage.sqlite) > I opened it with the tool db browser and it seems to be OK. At least I can > view all the tables and I checked a few entries which are still there. > Are there any tools you reccommend to verify and check it. > > I looked a little in the tables data and I found in addition to my 10 > users I was supposed to have there were roughly 100 more. with cryptic > names like qwertyuio... > So I might have been under an attack. I deleted those lines from my db. > but it still does not help. > > Any Idea why I can view it without a problem in this db browser but web2py > isn't showing it? > > > I tried to move away from sqlite some time ago, but I couldn't get it to > work, so I stuck with it Oo > -- 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.
Re: [web2py] Re: web2py broken
Hi thanks for the post villas. I have the database on my local pc. (storage.sqlite) I opened it with the tool db browser and it seems to be OK. At least I can view all the tables and I checked a few entries which are still there. Are there any tools you reccommend to verify and check it. I looked a little in the tables data and I found in addition to my 10 users I was supposed to have there were roughly 100 more. with cryptic names like qwertyuio... So I might have been under an attack. I deleted those lines from my db. but it still does not help. Any Idea why I can view it without a problem in this db browser but web2py isn't showing it? I tried to move away from sqlite some time ago, but I couldn't get it to work, so I stuck with it Oo -- 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.
[web2py] Re: New web2py/pydal feautures for scalability
This is a very welcome feature for scaling. Thanks Joe for your super-helpful post, I wish I had read it first! :) -- 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.
[web2py] Re: web2py broken
Hi Blueshadow, I think I would first make a copy of the SQLite database file and then use SQLite tools to examine and verify its integrity. By the way, whilst I find SQLite very useful for new experimental apps, I would not advise using SQLite in a production environment. I believe you will easily find free SQLite tools available online. Best wishes. -- 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.
Re: [web2py] web2py 2.17.1
Hi Massimo, Il giorno lun 6 ago 2018 alle ore 03:12 Massimo Di Pierro ha scritto: > > Hello everybody, > > I released pyDAL 18.08 and web2py 2.17.1 Could you release pyDAL also on Pypi?! We use it in buildroot and the recipe for downloading it and building it refers to pypi. Thanks! > They mostly contain bug fixes as well as better support for python 3 and > bootstrap 4 by default. > Thanks to all those who contributed! > > Please check them out and report any issue with them. > > I have a been a little slow checking this group because of lots of traveling > but I will do my best to catch up. :-) > > Massimo > > -- > 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. -- Profile: http://it.linkedin.com/in/compagnucciangelo -- 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.