On Message Submit: "Uncaught TypeError: Cannot read property 'validate' of undefined"

LabKey Support Forum (Inactive)
On Message Submit: "Uncaught TypeError: Cannot read property 'validate' of undefined" mauricio  2016-12-13 06:48
Status: Closed
 

Hello! I am interested in having Labkey 16.3 in production. I have a development machine with IntelliJ IDEA, in Ubuntu 16.04.

Running Labkey from the application (IntelliJ IDEA, in Debug or Run mode) everything works correctly.

Now, when I build the project and put it into production, I get an error when I want to Submit new messages. I press SUBMIT button and the message is not load. In Chrome console I get the next error:

Uncaught TypeError: Cannot read property 'validate' of undefined insert.view?returnUrl=%2Flabkey%2Fproject%2Fhome%2Fbegin.view%3F:620

        at HTMLFormElement.onsubmit (insert.view?returnUrl=%2Flabkey%2Fproject%2Fhome%2Fbegin.view%3F:620)

        at submitForm (internal.min.js?1928029702:1)

        at HTMLAnchorElement.onclick (insert.view?returnUrl=%2Flabkey%2Fproject%2Fhome%2Fbegin.view%3F:640)

See Error in MessageError.png (Attached file).

Can anybody help me again?

Thanks!

Mauricio

 
 
Jon (LabKey DevOps) responded:  2016-12-13 15:17
Hi Mauricio,

Sounds like something is missing from your production build, especially if this worked in your dev setup in IntelliJ.

Do you by chance have the binaries for that production build as a zip file or tar.gz? Would it be possible for you to provide that to us so we can test this on our end?

Regards,

Jon
 
mauricio responded:  2016-12-14 02:24
Hi Jon,
I just downloaded it using SVN and the next command:

sudo svn checkout --username cpas --password cpas https://hedgehog.fhcrc.org/tor/stedi/trunk /home/labkey

Mauricio
 
Jon (LabKey DevOps) responded:  2016-12-14 15:12
Hi Maurico,

But you said that you put the build into production. How did you do this? Did you compile the code and make binaries as a zip file or tar.gz to then run it on your production server?

If things worked in development via IntelliJ, but not in Production off of the same code, something must have changed between your development environment vs your production one.

Regards,

Jon
 
mauricio responded:  2016-12-15 07:08
Hi Jon,

In my development machine with IntelliJ, where everything works correctly, I did:

     BUILD --> LABKEY BUILD --> PRODUCTION

this finished successfully with the message: "Ant build completed successfully in 1m 20s at 15/12/16"
and made the next folders into $LABKEY_HOME/build/deploy/
    
     bin
     labkeyWebapp
     modules
     pipelineLib

I copied this folders in my production machine (I already had a functional version of labkey, what happened is that now I need to add modules) and the only thing that does not work for me is the subject of messages.

Regards,
Mauri
 
Jon (LabKey DevOps) responded:  2016-12-15 14:43
Hi Mauri,

Ok, this makes sense now. What you needed to do was an "ant production" in order to make a proper set of production files.

Please take a look at the following two links. Once you do ant production, your build should work:

https://www.labkey.org/home/Documentation/wiki-page.view?name=build#build
https://www.labkey.org/home/Documentation/wiki-page.view?name=productionBuilds

Regards,

Jon
 
mauricio responded:  2016-12-16 10:14
Thank you so much Jon! I did what you told me and now my LABKEY works perfectly in production! :)
Regards,
Mauri.
 
Jon (LabKey DevOps) responded:  2016-12-16 13:02
Great! Glad things are working now Mauri! We'll consider this matter closed!

Regards,

Jon