Closed Bug 439029 Opened 12 years ago Closed 11 years ago

database query error occurred when saving translation

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mozilla758+bmo, Assigned: nkoth)

References

Details

(Whiteboard: sumo_only)

Attachments

(1 file)

ID:kozawa
I translate the article「Customizing your Firefox with add-ons」to ja.
and error(below) occured when I pushed save button.

データベースクエリに問題があります!

Context:
File tiki-editpage.php
Url tiki-editpage.php?locale=ja
Query:
insert into `tiki_categorized_objects` (`catObjectId`) values (?)
Values:
0 NULL
Message:
Column 'catObjectId' cannot be null
Built query was probably:
insert into `tiki_categorized_objects` (`catObjectId`) values (NULL)
I confirmed the error with translating "test" page to Japanese:

When I start translating with "translate this page" link on
http://support.mozilla.com/ja/kb/test
and I pressed "Partial Translation" button. Then I got an error:


データベースクエリに問題があります!
# "An error occured in a database query!" in English

Context:
File	tiki-editpage.php
Url	tiki-editpage.php?locale=ja
Query:
insert into `tiki_categorized_objects` (`catObjectId`) values (?)
Values:
0	NULL
Message:
Column 'catObjectId' cannot be null
Built query was probably:
insert into `tiki_categorized_objects` (`catObjectId`) values (NULL)
Updating severity to critical. Is this related to yesterday's checkins?
Severity: normal → critical
Steps to reproduce:

1. Visit en-US article
2. Click "translate this page"
3. Select a language, enter a title and click "Create translation"
4. Under the edit box, click "Partial translation"
I tried with some other pages and sometimes I got an error with "Partical Translation" or "Complete Translation" but sometimes the article was saved correctly.

I don't have idea about when I can/cannot creat new translation...

Another example:

1. Visit http://support.mozilla.com/ja/kb/Using+SHOWFOR
2. Click "translate this page"
3. set title as "SHOWFOR の使い方" and clicked "Creating translation"
4. edit some and clicked "Partial translation"
5. below error is shown:

Context:
File	tiki-editpage.php
Url	tiki-editpage.php
Query:
insert into `tiki_translated_objects` (`type`,`objId`,`traId`,`lang`) values (?,?,?,?)
Values:
0	wiki page
1	NULL
2	352
3	ja
Message:
Column 'objId' cannot be null
Built query was probably:
insert into `tiki_translated_objects` (`type`,`objId`,`traId`,`lang`) values ('wiki page',NULL,'352','ja')

6. back to the previous page
7. press "Complete Translation"
8. I waited long time for server response.
9. New page was created:
http://support.mozilla.com/ja/kb/SHOWFOR+%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B
10. but the page is not set as translation of english page. the page is created as Japanese only page.


Same as above, I tested with 
http://support.mozilla.com/ja/kb/test
At first I got an error like above with both "Partial Translation" and "Complete Translation" but when I tried again with "Partial Translation" I had to wait for server response long time as above case but following page was created not showing error:
http://support.mozilla.com/ja/kb/%E3%83%86%E3%82%B9%E3%83%88
This page is also not set as traslation of original English. This page is created as Japanese only page.


That is, "Partial Translation" and "Complete Tranlation" sometimes show an error but sometimes create new non-translation page without any error.
Severity: critical → normal
Severity: normal → critical
When I translate the article that have no translation (i.e. the first translation.)  and save as Staging Area, the error was NOT OCCURED and set as translation of original English correctly.

http://support.mozilla.com/ja/kb/Windows+Media+Player+-+Mac-Linux

Then I change the category to Knowledge Base and save the article, the error was occured same with comment #0. But, the article was saved correctly.
OS: Windows XP → All
Hardware: PC → All
Nelson or LP, could you please take a look at what's going on here? 
Same for me:

Ocurrió un error en una consulta a la base de datos!

Context:
File	tiki-editpage.php
Url	tiki-editpage.php
Query:
insert into `tiki_translated_objects` (`type`,`objId`,`traId`,`lang`) values (?,?,?,?)
Values:
0	wiki page
1	NULL
2	314
3	es
Message:
Column 'objId' cannot be null
Built query was probably:
insert into `tiki_translated_objects` (`type`,`objId`,`traId`,`lang`) values ('wiki page',NULL,'314','es')

while trying to save a new translation.

seen yesterday as well with another translation
Any updates here?
After a discussion with Nelson, we ended up thinking that the problem could be related to the replication lag. After the object is created, the next read about it in the same page is made on a different database server and replication is not yet available.

This patch allows an operation to force all it's request to be made on the master. It is used for page editing operations which are likely to fail under these conditions.

The path uses a static variable so that the flag is set for all tikiwiki. Using a normal member variable in tikidb would cause problems as multiple instances can exist.

This is fully untested as I don't have the environment to test in, but the files do parse. Please test before placing in production.
Attachment #325581 - Flags: review+
Attachment #325581 - Flags: review?(nelson)
Attachment #325581 - Flags: review?(laura)
Attachment #325581 - Flags: review+
Comment on attachment 325581 [details] [diff] [review]
Potential fix to the problem

Good for me.  We should also add this in some other places in the code.
Attachment #325581 - Flags: review?(laura) → review+
Blocks: 440102
Nelson?
Nelson, can you please review this asap? It's one of the most annoying bugs we have in SUMO today. Thanks!
Attachment #325581 - Flags: review?(nelson) → review+
let's stage this.
This one slipped the radar in yesterdays triage meeting. 
Assignee: nobody → lphuberdeau
Priority: -- → P1
Target Milestone: --- → 0.6
This should block the 0.6 release.
Severity: critical → blocker
I would like to help, but I'm in the dark here. I have no idea which fixes have been incorporated in your branch, what the state is, and I don't have any data to reproduce the problem with.
I was under the impression that the submitted patch wasn't checked in yet. Nelson/Laura, what's the status of that?
I am having trouble reproducing the bug on support-stage. I can check the patch in , but do not know if I am actually doing correct testing.

Any ideas? Is there a way to artificially create replication lag for support-stage?
Blocks: 439440
Assignee: lphuberdeau → laura
Assignee: laura → nelson
Committed to trunk in r16566, prod branch in r16567.

Nelson, not easily, but since I don't think this patch will cause any problems we can see how it looks in production.
Status: NEW → RESOLVED
Closed: 12 years ago
Keywords: push-needed
Resolution: --- → FIXED
Component: Knowledge Base Articles → Knowledge Base Software
Duplicate of this bug: 444995
Has this been deployed yet, or is this scheduled for 0.6.1? As evidenced by the duplicate, people were still seeing this last week.
The fix in this bug solved some but not all related issues. The fix in bug 447903 (scheduled for 0.6.1 push) should help to solve all remaining issues regarding translation links "not there" after translations.
Reopening. Delphine said she got this error once this week. Delphine, if you get this error again, could you please copy the full error message and post it here in this bug? Thanks!
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Sure no problem, I'll keep a look on this !
It hasn't happened again yet, but I'll be sure to notify you if ever it does.
Has anyone seen this recently?
Keywords: push-needed
This looks fixed.  It certainly isn't a blocker.
Severity: blocker → normal
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Priority: P1 → --
Resolution: --- → FIXED
I haven't had any problems since !
Verified per comment 27.
Status: RESOLVED → VERIFIED
Summary: database query error occured when saving translation → database query error occurred when saving translation
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.