fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

[FAS3] can't generate Fake data when trying to setup a new test instance #219

Closed ryanlerch closed 7 years ago

ryanlerch commented 7 years ago

When trying to set up a new test instance, the step to generate fake data fails with the following error:

2016-12-05 06:15:05,727 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_cursor_execute:1235] SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
2016-12-05 06:15:05,727 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_cursor_execute:1236] ()
2016-12-05 06:15:05,728 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_cursor_execute:1235] SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
2016-12-05 06:15:05,728 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_cursor_execute:1236] ()
2016-12-05 06:15:05,728 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_begin_impl:679] BEGIN (implicit)
2016-12-05 06:15:05,730 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_execute_context:1140] SELECT people.id AS people_id, people.username AS people_username, people.password AS people_password, people.fullname AS people_fullname, people.ircnick AS people_ircnick, people.avatar AS people_avatar, people.avatar_id AS people_avatar_id, people.introduction AS people_introduction, people.postal_address AS people_postal_address, people.country_code AS people_country_code, people.locale AS people_locale, people.birthday AS people_birthday, people.birthday_month AS people_birthday_month, people.telephone AS people_telephone, people.facsimile AS people_facsimile, people.affiliation AS people_affiliation, people.bio AS people_bio, people.timezone AS people_timezone, people.gpg_fingerprint AS people_gpg_fingerprint, people.ssh_key AS people_ssh_key, people.email AS people_email, people.recovery_email AS people_recovery_email, people.bugzilla_email AS people_bugzilla_email, people.email_token AS people_email_token, people.unverified_email AS people_unverified_email, people.security_question AS people_security_question, people.security_answer AS people_security_answer, people.login_attempt AS people_login_attempt, people.password_token AS people_password_token, people.old_password AS people_old_password, people.certificate_serial AS people_certificate_serial, people.status AS people_status, people.status_timestamp AS people_status_timestamp, people.privacy AS people_privacy, people.email_alias AS people_email_alias, people.blog_rss AS people_blog_rss, people.latitude AS people_latitude, people.longitude AS people_longitude, people.fas_token AS people_fas_token, people.github_token AS people_github_token, people.twitter_token AS people_twitter_token, people.login_timestamp AS people_login_timestamp, people.creation_timestamp AS people_creation_timestamp, people.update_timestamp AS people_update_timestamp, signed_license_agreement_1.id AS signed_license_agreement_1_id, signed_license_agreement_1.license_id AS signed_license_agreement_1_license_id, signed_license_agreement_1.person_id AS signed_license_agreement_1_person_id 
FROM people LEFT OUTER JOIN signed_license_agreement AS signed_license_agreement_1 ON people.id = signed_license_agreement_1.person_id
2016-12-05 06:15:05,730 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_execute_context:1143] ()
2016-12-05 06:15:05,732 INFO  [MainThread:2930][sqlalchemy.engine.base.Engine:base][_rollback_impl:699] ROLLBACK
Traceback (most recent call last):
  File "/usr/bin/fas-admin", line 9, in 
    load_entry_point('fas==3.0.1', 'console_scripts', 'fas-admin')()
  File "/vagrant/fas/scripts/admin.py", line 365, in main
    people = DBSession.query(People).all()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2645, in all
    return list(self)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2797, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2820, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1393, in _handle_dbapi_exception
    exc_info
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 469, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: people.status_timestamp [SQL: u'SELECT people.id AS people_id, people.username AS people_username, people.password AS people_password, people.fullname AS people_fullname, people.ircnick AS people_ircnick, people.avatar AS people_avatar, people.avatar_id AS people_avatar_id, people.introduction AS people_introduction, people.postal_address AS people_postal_address, people.country_code AS people_country_code, people.locale AS people_locale, people.birthday AS people_birthday, people.birthday_month AS people_birthday_month, people.telephone AS people_telephone, people.facsimile AS people_facsimile, people.affiliation AS people_affiliation, people.bio AS people_bio, people.timezone AS people_timezone, people.gpg_fingerprint AS people_gpg_fingerprint, people.ssh_key AS people_ssh_key, people.email AS people_email, people.recovery_email AS people_recovery_email, people.bugzilla_email AS people_bugzilla_email, people.email_token AS people_email_token, people.unverified_email AS people_unverified_email, people.security_question AS people_security_question, people.security_answer AS people_security_answer, people.login_attempt AS people_login_attempt, people.password_token AS people_password_token, people.old_password AS people_old_password, people.certificate_serial AS people_certificate_serial, people.status AS people_status, people.status_timestamp AS people_status_timestamp, people.privacy AS people_privacy, people.email_alias AS people_email_alias, people.blog_rss AS people_blog_rss, people.latitude AS people_latitude, people.longitude AS people_longitude, people.fas_token AS people_fas_token, people.github_token AS people_github_token, people.twitter_token AS people_twitter_token, people.login_timestamp AS people_login_timestamp, people.creation_timestamp AS people_creation_timestamp, people.update_timestamp AS people_update_timestamp, signed_license_agreement_1.id AS signed_license_agreement_1_id, signed_license_agreement_1.license_id AS signed_license_agreement_1_license_id, signed_license_agreement_1.person_id AS signed_license_agreement_1_person_id \nFROM people LEFT OUTER JOIN signed_license_agreement AS signed_license_agreement_1 ON people.id = signed_license_agreement_1.person_id']

`

skrzepto commented 7 years ago

Which db are you using postgres or sqlite?

skrzepto commented 7 years ago

Also what cmd did you run first? By any chance did you run fas-admin -c development.ini --initdb

ryanlerch commented 7 years ago

Yes, I was following the directions in the readme, so i did run fas-admin -c development.ini --initdb first.

ryanlerch commented 7 years ago

adding --default-value worked for me now. thanks.