Giter VIP home page Giter VIP logo

Comments (6)

deepgully avatar deepgully commented on August 22, 2024

我没遇到哦, 在 本地, BAE, GAE, 本地GAE 我都试过啦
能看看BAE的log吗?

from me.

jizhilong avatar jizhilong commented on August 22, 2024
Error in dispatch_action:
Traceback (most recent call last):
File "instance0/codefs/jizhilong.duapp.com/ajax.py", line 908, in dispatch_action res = method(**parameters)
File "instance0/codefs/jizhilong.duapp.com/apis/common.py", line 228, in wrapper return method(*args, **kwargs)
File "instance0/codefs/jizhilong.duapp.com/ajax.py", line 458, in delete_post post.delete()
File "instance0/codefs/jizhilong.duapp.com/apis/common.py", line 542, in delete self.db_object.delete(commit=True)
File "instance0/codefs/jizhilong.duapp.com/model/model_bae.py", line 220, in delete self.commit()
File "instance0/codefs/jizhilong.duapp.com/model/model_bae.py", line 243, in commit db.session.commit()
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 113, in do return getattr(self.registry(), name)(*args, **kwargs)
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 655, in commit self.transaction.commit()
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 313, in commit self._prepare_impl()
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 297, in _prepare_impl self.session.flush()
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1559, in flush self._flush(objects)
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1630, in _flush flush_context.execute()
File "instance0/pyruntime/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 331, in execute rec.

from me.

deepgully avatar deepgully commented on August 22, 2024

我这里没法重现了
看起来是在删除post对应的stats的时候发现数据库里面没有相应的stats
你先检查一下你的数据库的db_stats表有什么异常

from me.

jizhilong avatar jizhilong commented on August 22, 2024

在bae提供的phpmyadmin里边试了下,先删除post,再删除相应的stat没有问题,反过来的话就会报跟lz给出的相同错误。

from me.

jizhilong avatar jizhilong commented on August 22, 2024

似乎由于某种原因,导致stat删除在先,post删除在后,而stat是post的外键,删除它会导致post指向一条不明确的stat记录。在phpadmin中执行如下代码,使得删除stat时,将指向它的post的_stat_id设置为null,可以暂时解决此问题:

ALTER TABLE `db_post` 
DROP FOREIGN KEY `db_post_ibfk_1`;  

ALTER TABLE `db_post`
ADD CONSTRAINT `db_post_ibfk_1` FOREIGN KEY (`_stats_id`) 
REFERENCES `db_stats` (`id`) ON DELETE SET NULL;

from me.

deepgully avatar deepgully commented on August 22, 2024

已经更新了, 请试试这个版本

from me.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.