Can't locate object method "in_storage" via package "Math::BigInt"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't locate object method "in_storage" via package "Math::BigInt"

Alex Povolotsky
Hello

Suddenly I'm unable to insert data into my table.

Just plain class, autogenerated with dbicdump.

   "insta_id",
   { data_type => "bigint", is_nullable => 0 },

Insert goes ok, but than

Can't locate object method "in_storage" via package "Math::BigInt" at
/usr/local/lib/perl5/site_perl/DBIx/Class/Row.pm line 252. at
/usr/local/lib/perl5/site_perl/DBIx/Class/Schema.pm line 1118.

Please help

Alex

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't locate object method "in_storage" via package "Math::BigInt"

Len Jaffe

On Wed, Jan 4, 2017 at 3:58 PM, Alex Povolotsky <[hidden email]> wrote:
Suddenly I'm unable to insert data into my table.
[snip]
 
Can you insert data via the command line?

--
Len Jaffe - Information Technology Smoke Jumper - [hidden email] 
614-404-4214    @LenJaffe  www.lenjaffe.com
Curator of Advent Planet - An Aggregation of Online Advent Calendars.


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't locate object method "in_storage" via package "Math::BigInt"

Alex Povolotsky
Yes; moreover, from different computer the code

my $owner = $schema->resultset('InstaPerson')->find_or_create( {
 
insta_id => 178873658,
                                                                },
                                                                {
                                                                 key =>
'instabot_instagram_id_idx' },
                                                              );

works just fine. Same version of DBIx::Class.

I've tried to copy Result file for InstaPerson, no success.

On 05.01.2017 0:07, Len Jaffe wrote:

>
> On Wed, Jan 4, 2017 at 3:58 PM, Alex Povolotsky <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Suddenly I'm unable to insert data into my table.
>     [snip]
>
>
> Can you insert data via the command line?
>
> --
> Len Jaffe - Information Technology Smoke Jumper
> - [hidden email] <mailto:[hidden email]>
> 614-404-4214    @LenJaffe <https://www.twitter.com/lenJaffe>
>  www.lenjaffe.com <http://www.lenjaffe.com/>
> Host of Code Jam Columbus <http://www.meetup.com/techlifecolumbus/>  -
> @CodeJamCMH <https://www.twitter.com/CodeJamCMH>
> Curator of Advent Planet <http://www.lenjaffe.com/AdventPlanet/> - An
> Aggregation of Online Advent Calendars.
>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@...
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't locate object method "in_storage" via package "Math::BigInt"

Alex Povolotsky
Things are getting more and more strange.

Attempt to isolate code failed; simple one-liner works.

$inode->{owner}->{id} from the original code is not an object.

In fact, problem was in different line, where plain status => 1 somehow
turned into          'status' => bless( {
                                'sign' => '+',
                                'value' => [
                                             1
                                           ]
                              }, 'Math::BigInt' ),

I have no idea of how can it be...

On 05.01.2017 0:12, Alex Povolotsky wrote:

> Yes; moreover, from different computer the code
>
> my $owner = $schema->resultset('InstaPerson')->find_or_create( {
>
> insta_id => 178873658,
>                                                                },
>                                                                {
>                                                                 key =>
> 'instabot_instagram_id_idx' },
>                                                              );
>
> works just fine. Same version of DBIx::Class.
>
> I've tried to copy Result file for InstaPerson, no success.
>
> On 05.01.2017 0:07, Len Jaffe wrote:
>>
>> On Wed, Jan 4, 2017 at 3:58 PM, Alex Povolotsky <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     Suddenly I'm unable to insert data into my table.
>>     [snip]
>>
>>
>> Can you insert data via the command line?
>>
>> --
>> Len Jaffe - Information Technology Smoke Jumper
>> - [hidden email] <mailto:[hidden email]>
>> 614-404-4214    @LenJaffe <https://www.twitter.com/lenJaffe>
>>  www.lenjaffe.com <http://www.lenjaffe.com/>
>> Host of Code Jam Columbus <http://www.meetup.com/techlifecolumbus/>  -
>> @CodeJamCMH <https://www.twitter.com/CodeJamCMH>
>> Curator of Advent Planet <http://www.lenjaffe.com/AdventPlanet/> - An
>> Aggregation of Online Advent Calendars.
>>
>>
>>
>> _______________________________________________
>> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>> IRC: irc.perl.org#dbix-class
>> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>> Searchable Archive:
>> http://www.grokbase.com/group/dbix-class@...
>>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@...
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't locate object method "in_storage" via package "Math::BigInt"

Robert Stone
Greetings,

Can you share the full DBIx::Class::Schema file?

It sounds like you have some inflation/deflation going on, similar to what happens to DateTime objects and datetime types if you include:

__PACKAGE__->load_components(qw/InflateColumn::DateTime/);

If this is affecting all of your columns with a type of bigint and something is causing that to get inflated to a Math::BigInt object it would explain the errors and behavior you are seeing.

Also, is it correct to assume that $inode in your example is a DBIx::Result?  If so, be sure to reference via the public interface $inode->owner->id instead of via the "private-ish" HashRef.

Best Regards,
Robert Stone

On Wed, Jan 4, 2017 at 4:42 PM, Alex Povolotsky <[hidden email]> wrote:
Things are getting more and more strange.

Attempt to isolate code failed; simple one-liner works.

$inode->{owner}->{id} from the original code is not an object.

In fact, problem was in different line, where plain status => 1 somehow turned into          'status' => bless( {
                               'sign' => '+',
                               'value' => [
                                            1
                                          ]
                             }, 'Math::BigInt' ),

I have no idea of how can it be...


On 05.01.2017 0:12, Alex Povolotsky wrote:
Yes; moreover, from different computer the code

my $owner = $schema->resultset('InstaPerson')->find_or_create( {

insta_id => 178873658,
                                                               },
                                                               {
                                                                key =>
'instabot_instagram_id_idx' },
                                                             );

works just fine. Same version of DBIx::Class.

I've tried to copy Result file for InstaPerson, no success.

On 05.01.2017 0:07, Len Jaffe wrote:

On Wed, Jan 4, 2017 at 3:58 PM, Alex Povolotsky <[hidden email]
<mailto:[hidden email]>> wrote:

    Suddenly I'm unable to insert data into my table.
    [snip]


Can you insert data via the command line?

--
Len Jaffe - Information Technology Smoke Jumper
- [hidden email] <mailto:[hidden email]>
<a href="tel:614-404-4214" value="+16144044214" target="_blank">614-404-4214    @LenJaffe <https://www.twitter.com/lenJaffe>
 www.lenjaffe.com <http://www.lenjaffe.com/>
Host of Code Jam Columbus <http://www.meetup.com/techlifecolumbus/>  -
@CodeJamCMH <https://www.twitter.com/CodeJamCMH>
Curator of Advent Planet <http://www.lenjaffe.com/AdventPlanet/> - An
Aggregation of Online Advent Calendars.



_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive:
http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive:
http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't locate object method "in_storage" via package "Math::BigInt"

Matt S Trout-2
In reply to this post by Alex Povolotsky
On Thu, Jan 05, 2017 at 01:42:04AM +0300, Alex Povolotsky wrote:

> Things are getting more and more strange.
>
> Attempt to isolate code failed; simple one-liner works.
>
> $inode->{owner}->{id} from the original code is not an object.
>
> In fact, problem was in different line, where plain status => 1
> somehow turned into          'status' => bless( {
>                                'sign' => '+',
>                                'value' => [
>                                             1
>                                           ]
>                              }, 'Math::BigInt' ),

If statuf is set up as a relationship that'd explain DBIC calling
in_storage on it.
 
> I have no idea of how can it be...

Check your code for a 'use bigint;' - that uses overload::constant
to turn bare numbers into Math::BigInt objects, which would explain
how a plain 'status => 1' could do that. You could also check to
see if something's messing with it using:

    use Devel::Dwarn;
    Dwarn 1;

(you do already have that module, it's a dependency of ours)

--
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our CPAN
commercial support, training and consultancy packages could help your team.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Loading...