Hi Shakeel,

It appears that you are referring to:
  class Target_File(models.Model):
    path = models.FilePathField()

Looking at the documentation for this field type  
(https://docs.djangoproject.com/en/2.1/ref/models/fields/), I see: 
“FilePathField<https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.FilePathField>
 instances are created in your database as varchar columns with a default max 
length of 100 characters. As with other fields, you can change the maximum 
length using the 
max_length<https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.CharField.max_length>
 argument.”

Clearly 100 characters is very limited, as revealed in your issue. Here are the 
choices:

  (a) We could go with a TextField redefinition, and have no limit. The problem 
is that we lose the associated methods of FIlePathField. I can review the 
Toaster code to see if we are actually leveraging those methods, either 
directly in the Python code or implicitly in the template code.

  (b) Increase the “max_length” to some larger value, for example simply 
doubling the default to 200 characters. We could still hit that limit, but 
perhaps vanishingly.

Can you give guidance as to what path lengths you are requiring? That will help 
give us a real world use case.

Thanks,
David





From: [email protected] 
[mailto:[email protected]] On Behalf Of Muhammad Shakeel Khan
Sent: Wednesday, October 03, 2018 5:53 AM
To: [email protected]
Subject: [Toaster] Toaster database error

Hi,

I have setup Toaster production instance using Rocko 2.4.2 and it works fine 
usually.

Some of our builds have mono libraries and related files (with very long paths 
of files to be installed) and for that build I see the following error:

ERROR: (1406, "Data too long for column 'path' at row 1")

And with this error the Toaster fails to show correct status of a command line 
build.

I have worked around this by setting Mysql non-strict mode but that doesn't 
look like a good solution and may lead to other errors.

Do you think we can change the SQL entry that specifies the length of 'path' 
element? What is the limit on this?

Best Regards,
Shakeel
-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Reply via email to