Blank screen after creating a Case

Hi
When I want to create a “Case”, after clicking on save I get a blank screen with this url: myhost/index.php

How could I find the cause and solution?

My SuiteCRM version: 7.6.4

Here is the log:

08/06/16 04:20:13 [4060][1][FATAL] Error inserting into table: cases: Query Failed: INSERT INTO cases (id,name,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,type,status,priority,resolution,account_id,state)
					VALUES ('efd16f0a-48f4-cff6-3a79-57a5c770d3c9','تست','2016-08-06 11:20:11','2016-08-06 11:20:11','1','1','',0,'1','Administration','Open_New','P1','','cbc1936b-2ccc-00ce-cf7d-57207c5c3385','Open'): MySQL error 1062: Duplicate entry '0' for key 'casesnumk'
08/06/16 04:20:13 [4060][1][FATAL] Exception in Controller: Database failure. Please refer to SuiteCRM error log file for details.

I checked the database and last case was created by case_number = 0
I deleted that record and everything is back to normal

But when I create another case, it will be saved again by case_number = 0. Then again for creating another Case I get blank screen.

Any idea?

up

Please tell me how to make this table create Cases with case_numbers from a specific number.
I have about 118 cases right now. But when I want to create a new case it is created with case_number = 1 which is a duplicate case_number and I face FATAL error and blank screen.
How can I set this auto generated number to 119 or make it understand the last record case_number?

I don’t know anything at all about this particular issue, but Googling around I believe this should help you:

http://support.sugarcrm.com/Knowledge_Base/Administration/Studio_and_Module_Builder/Setting_Starting_Numbers_for_Quotes_Cases_and_Bugs/

Also related to this (and probably a faster way to solve your problem): on phpMyAdmin, on the “cases” table, select the “Structures” tab and you’ll see there’s a “AUTO_INCREMENT” attribute on the “case_number” field.

If you select the “operations” tab, you’ll see the auto-increment value there. Try playing with that, I’m sure you can make it work.

Thanks for your reply.
I followed the Studio method but when I change the “Auto Increment Next Value” and hit save, it is not changed.
I also followed the phpMyAdmin but I couldn’t find any value to change.

And I need to tell you that in Studio for the case_number field the “Auto Increment Next Value” is set to 1. But when I create a new Case, it is saved with case_number = 0 and for the next record I get the error.

You can do it with SQL:

http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html

1 Like

You should be able to edit anything under studio. Make sure your permissions are correct. As not being able to edit can be signs of bigger problems. A clean install does not have issues like yours.

I’m working on localhost using Bitnami wampstack.
Where can I find the cause of this “Bigger Problem”?
I have plenty of FATAL ERRORs in my log which I don’t know how to resolve them.

I have uploaded the suitrecrm.log file. I’d appreciate if you guys take a look.
http://s000.tinyupload.com/index.php?file_id=63962608626584554307

P.S: It may be relevant thatt I had upgraded from 7.5.3 to 7.6.4 and faced a significantly high server response time (10seconds) and here a solution was suggested therefore I deleted all reminders using phpMyAdmin. (We don’t need reminders).

By bigger problem si mean, a corrupt DB, having incorrect permissions set on your files and folder, wrong PHP configuration. I would recommend to build the CRM on a CENTOS7 server from a minimal install. Then install the CRM on a LAMP stack instead of WAMP. But that is my personal preference. I’ve been running sugar/suitecrm for 3 years or more now.

@angrymob I appreciate your input but it wasn’t helpful and much related to this specific problem.
If others have any other idea or solution please share.

I have changed the case_number to null-able so for now the problem is hidden (not solved).
Any help would be appreciated.

You didn’t say if you were able to change the auto-increment value… could you do it with SQL?

What happened then?

I don’t know how to do it. I followed the links you provided, but frankly I am not expert in SQL and phpMyAdmin.

What’s complicated about this?

ALTER TABLE cases AUTO_INCREMENT = 300;

I don’t know most of the things you ask me either, I just Google around and try things. You need to have more confidence in yourself and you will see the answers right in front of you! : - )

ALTER TABLE `cases` AUTO_INCREMENT = 125

This is the message after I RUN the query above:

MySQL returned an empty result set (i.e. zero rows). (Query took 0.1112 seconds.)

And the problem is not solved.


P.S: When I face a problem I first google it and deal with all the answers for at least one week :D. And only when I find no solution I open a topic about it here. There has been plenty of problems which I have solved by googling around which I’ve never brought them here. :wink:
But sometimes either I find no answer or the provided answer do not work for me.
Anyway I thank you because you have solved most of my problems. I hope one day I could solve others.

I wonder if the auto_increment number actually changed to 125? It sounds like the query ran without error…

You might really have a “deeper problem” as someone else already mentioned on this thread.

And about Google not being enough… you’re right, sometimes it’s not enough. To get back to an advice I already gave you on another thread: debugging. If you lose two weeks setting up debugging, you will still find it a good investment of time. It will be of use to use many times in the future. And in reality, it shouldn’t take you that long to set it up.

Having the ability to debug code really lets you go into the problems, instead of just looking at a “black box” from the outside. And, for me, it’s one of the BIG advantages of open-source software: you get to debug the source - all of it.

1.Where should I check the “auto_increment” value?

2.Do you know how should I explore this “deeper problem”? Because I think I have the same problem on table “trackers”.

3.I will soon setup a debug environment because I am working on some other open-source softwares. but for now I need to solve this.