6

17 comments

[–] curious [OP] 0 points (+0|-0) Edited

Thanks again @E-werd. Got it.

I'm almost there.

cd scripts
./install.py
cd ..
nano wsgi.py
#socketio.run(app, debug=True, host='0.0.0.0')

When I run ./install.py, I get bash: ./install.py: No such file or directory. The install.py isn't there obviously as can be seen here.

These are the only files available in the scripts directory.

__fix.py admins.py clean_subs.py defaults.py migrate.py

  • What should I do now? It's a clean install btw.

  • EDIT: Would it be save to make a copy of the install.py file?

[–] E-werd 1 points (+1|-0)

So what you're running into now is a dated form of the guide. The file install.py has been replaced with migrate.py and can be used in the same way. This also gets used later on if and when the structure of the database changes. You'll know to use it if you see errors relating to missing fields.

Here's the most up-to-date guide I have specifically for mysql/mariadb. Note that I've started using Alpine Linux now as that will ultimately be what I use if/when I finally get around to learning Docker as it's a tried-and-true linux distribution for this purpose. https://pastebin.com/Pdqh2Ji9

Also, if you're interested in using MySQL/MariaDB, Postgresql, or SQLite, then you might want to look at this link. We recently moved to Postgresql for the live site for performance and data integrity reasons, and while we were at it we made sure SQLite was working as well. SQLite is actually a great way to get a quick test or development instance running without configuring a database. https://pastebin.com/zFfLuMV6

[–] curious [OP] 1 points (+1|-0) Edited

So what you're running into now is a dated form of the guide. The file install.py has been replaced with migrate.py and can be used in the same way.

That's really good to know!

Note that I've started using Alpine Linux now as that will ultimately be what I use if/when I finally get around to learning Docker as it's a tried-and-true linux distribution for this purpose. https://pastebin.com/Pdqh2Ji9

I loved it. As a start, I'm taking screen shots as I go and I plan up to come up with some sort of Installation guide (IG) for noobs like me - though I don't have any timeline for this. The notes in your pastebin is really going to help in extending the IG.

[–] curious [OP] 0 points (+0|-0)

Arrr. Spoke too soon! Running ./migrate.py is throwing up the following. I'm embarrassing myself here.

Database connection error? Any ideas @E-werd?

Starting migrations
Migrate "001_initial"
Migration failed: 001_initial
Traceback (most recent call last):
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2949, in execute_sql
    cursor.execute(sql, params or ())
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 312, in _query
    db.query(q)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/connections.py", line 224, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1101, "BLOB, TEXT, GEOMETRY or JSON column 'sidebar' can't have a default value")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee_migrate/router.py", line 154, in run_one
    migrator.run()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee_migrate/migrator.py", line 131, in run
    op()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 6296, in create_table
    cls._schema.create_all(safe, **options)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 5456, in create_all
    self.create_table(safe, **table_options)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 5311, in create_table
    self.database.execute(self._create_table(safe=safe, **options))
  File "../app/models.py", line 64, in peewee_count_queries
    return dex(*args, **kwargs)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2962, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2956, in execute_sql
    self.commit()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2732, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2949, in execute_sql
    cursor.execute(sql, params or ())
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 312, in _query
    db.query(q)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/connections.py", line 224, in query
    _mysql.connection.query(self, query)
peewee.OperationalError: (1101, "BLOB, TEXT, GEOMETRY or JSON column 'sidebar' can't have a default value")
Traceback (most recent call last):
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2949, in execute_sql
    cursor.execute(sql, params or ())
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 312, in _query
    db.query(q)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/connections.py", line 224, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1101, "BLOB, TEXT, GEOMETRY or JSON column 'sidebar' can't have a default value")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./migrate.py", line 25, in <module>
    router.run()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee_migrate/router.py", line 182, in run
    self.run_one(mname, migrator, fake=fake, force=fake)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee_migrate/router.py", line 154, in run_one
    migrator.run()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee_migrate/migrator.py", line 131, in run
    op()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 6296, in create_table
    cls._schema.create_all(safe, **options)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 5456, in create_all
    self.create_table(safe, **table_options)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 5311, in create_table
    self.database.execute(self._create_table(safe=safe, **options))
  File "../app/models.py", line 64, in peewee_count_queries
    return dex(*args, **kwargs)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2962, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2956, in execute_sql
    self.commit()
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2732, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/peewee.py", line 2949, in execute_sql
    cursor.execute(sql, params or ())
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/cursors.py", line 312, in _query
    db.query(q)
  File "/home/app/.pyenv/versions/app/lib/python3.5/site-packages/MySQLdb/connections.py", line 224, in query
    _mysql.connection.query(self, query)
peewee.OperationalError: (1101, "BLOB, TEXT, GEOMETRY or JSON column 'sidebar' can't have a default value")
(app) app@DESKTOP-K7K63GA:~/throat/scripts$