FormPlayer throw error when upload media or icon with form

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png
HI All/Cory

I setup commcarehq and formplayer as well xformplayer
So far all working properly

I am facing one issue when I create a form using feturedflag and “New Cloud
Care”
so this time it uses webapps to preview the form and Formplayer play form
It work properly untill I added iconns or media

As soon as I add icon it throw errors please see screenshot

https://lh3.googleusercontent.com/-4Fm2gep8ZNs/WFJQtA2JWxI/AAAAAAAAAH0/jXetcAewFbYnYbbZ3MCmEMn2Cra7ytsUwCEw/s1600/error.png

please see error log

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png

I am using folowing configuration

Couchdb
Postgres
Elasticsaerch
Kafka

Please help me for the same.

Thanks
Mul

Hey Mul,

Great to hear you’ve gotten so far along with CommCareHQ and Formplayer.

As you might’ve surmised that errors message occurs when your form
reference some multimedia that isn’t available in the application. In this
case, the missing item looks to the be the image displayed in the form
select screen for the first form in the first module. When you view the
multimedia upload screen for this form what do you see? That screen should
be available here:

[image: Inline image 1]
If that screen looks correct (IE an image looks to be successfully
uploaded) you can check that the image is being included correctly in the
multimedia on the deploy screen:

[image: Inline image 2]

If you download this zip file you should be able to unzip it and see an
image named module0_form0_en.png. If you can’t I’d try re-deploying or
re-uploading the image.

Cheers,
Will

··· On Thu, Dec 15, 2016 at 3:16 AM, Mul Shanker wrote:

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png
HI All/Cory

I setup commcarehq and formplayer as well xformplayer
So far all working properly

I am facing one issue when I create a form using feturedflag and “New
Cloud Care”
so this time it uses webapps to preview the form and Formplayer play form
It work properly untill I added iconns or media

As soon as I add icon it throw errors please see screenshot

https://lh3.googleusercontent.com/-4Fm2gep8ZNs/WFJQtA2JWxI/AAAAAAAAAH0/jXetcAewFbYnYbbZ3MCmEMn2Cra7ytsUwCEw/s1600/error.png

please see error log

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png

I am using folowing configuration

Couchdb
Postgres
Elasticsaerch
Kafka

Please help me for the same.

Thanks
Mul


You received this message because you are subscribed to the Google Groups
“CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks Will

This is great and thanks for quick reply

Like you mention on reply I tried to click download and I am getting this
error, note that I can see image on form but not Preview form, It seems we
have miss some
configuration , Alos please note that it works properly for cloudcare but
not work for web app form preview.

Thanks can you please help for the same

https://lh3.googleusercontent.com/-XMdTXx8HKbE/WFK6MfN97pI/AAAAAAAAAIQ/HF-Zfbp0V3AmqWcZMpHDy5gP73yLHv75QCLcB/s1600/error-2.png

··· On Thursday, 15 December 2016 18:43:47 UTC+5:30, William Pride wrote: > > Hey Mul, > > Great to hear you've gotten so far along with CommCareHQ and Formplayer. > > As you might've surmised that errors message occurs when your form > reference some multimedia that isn't available in the application. In this > case, the missing item looks to the be the image displayed in the form > select screen for the first form in the first module. When you view the > multimedia upload screen for this form what do you see? That screen should > be available here: > > [image: Inline image 1] > If that screen looks correct (IE an image looks to be successfully > uploaded) you can check that the image is being included correctly in the > multimedia on the deploy screen: > > [image: Inline image 2] > > If you download this zip file you should be able to unzip it and see an > image named module0_form0_en.png. If you can't I'd try re-deploying or > re-uploading the image. > > Cheers, > Will > > > On Thu, Dec 15, 2016 at 3:16 AM, Mul Shanker <mulsh...@gmail.com > wrote: > >> >> >> HI All/Cory >> >> >> I setup commcarehq and formplayer as well xformplayer >> So far all working properly >> >> I am facing one issue when I create a form using feturedflag and "New >> Cloud Care" >> so this time it uses webapps to preview the form and Formplayer play form >> It work properly untill I added iconns or media >> >> As soon as I add icon it throw errors please see screenshot >> >> >> >> >> please see error log >> >> >> >> >> >> >> I am using folowing configuration >> >> Couchdb >> Postgres >> Elasticsaerch >> Kafka >> >> Please help me for the same. >> >> Thanks >> Mul >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CommCare Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-developers+unsubscribe@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >

Mul,

That last error you showed usually means that celery (an asynchronous task
queue) is either not running or not connected. You can run that with this
command:

$ ./manage.py celeryd --verbosity=2 --beat --statedb=celery.db --events

Alternatively, you can force those tasks to run in the foreground by
setting CELERY_ALWAYS_EAGER = True in your localsettings.py file. This
is useful in development, but I wouldn’t recommend it in production.

  • Ethan
··· On Thu, Dec 15, 2016 at 10:46 AM, Mul Shanker wrote:

Thanks Will

This is great and thanks for quick reply

Like you mention on reply I tried to click download and I am getting this
error, note that I can see image on form but not Preview form, It seems we
have miss some
configuration , Alos please note that it works properly for cloudcare but
not work for web app form preview.

Thanks can you please help for the same

https://lh3.googleusercontent.com/-XMdTXx8HKbE/WFK6MfN97pI/AAAAAAAAAIQ/HF-Zfbp0V3AmqWcZMpHDy5gP73yLHv75QCLcB/s1600/error-2.png

On Thursday, 15 December 2016 18:43:47 UTC+5:30, William Pride wrote:

Hey Mul,

Great to hear you’ve gotten so far along with CommCareHQ and Formplayer.

As you might’ve surmised that errors message occurs when your form
reference some multimedia that isn’t available in the application. In this
case, the missing item looks to the be the image displayed in the form
select screen for the first form in the first module. When you view the
multimedia upload screen for this form what do you see? That screen should
be available here:

[image: Inline image 1]
If that screen looks correct (IE an image looks to be successfully
uploaded) you can check that the image is being included correctly in the
multimedia on the deploy screen:

[image: Inline image 2]

If you download this zip file you should be able to unzip it and see an
image named module0_form0_en.png. If you can’t I’d try re-deploying or
re-uploading the image.

Cheers,
Will

On Thu, Dec 15, 2016 at 3:16 AM, Mul Shanker mulsh...@gmail.com wrote:

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png
HI All/Cory

I setup commcarehq and formplayer as well xformplayer
So far all working properly

I am facing one issue when I create a form using feturedflag and "New
Cloud Care"
so this time it uses webapps to preview the form and Formplayer play form
It work properly untill I added iconns or media

As soon as I add icon it throw errors please see screenshot

https://lh3.googleusercontent.com/-4Fm2gep8ZNs/WFJQtA2JWxI/AAAAAAAAAH0/jXetcAewFbYnYbbZ3MCmEMn2Cra7ytsUwCEw/s1600/error.png

please see error log

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png

I am using folowing configuration

Couchdb
Postgres
Elasticsaerch
Kafka

Please help me for the same.

Thanks
Mul


You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks Ethan/William

We tried the celeryd, it was already look correct to me.

After that I debug code and found issue and fix it , after that form is
working properly

Below is details

Class name : BasicInstaller
Method name : install
This code always return false for RESOURCE_AUTHORITY_REMOTE, even incoming
is not null
I change code to return if incoming is not null becuase url is correct and
we get image from remote

@Override
public boolean install(Resource r, ResourceLocation location, Reference
ref, ResourceTable table, CommCarePlatform instance, boolean upgrade) throws
UnresolvedResourceException {
//If we have local resource authority, and the file exists, things
are golden. We can just use that file.

    if (location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL) {
    
        try {
            //If the file isn't there, not much we can do about it.
            return ref.doesBinaryExist();
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        }
    } else if (location.getAuthority() == Resource.

RESOURCE_AUTHORITY_REMOTE) {

        //We need to download the resource, and store it locally. 

Either in the cache
//(if no resource location is available) or in a local
reference if one exists.
InputStream incoming;
try {
incoming = ref.getStream();

        } catch (IOException e) {


            e.printStackTrace();
            return false;
        }
        if (incoming == null) {
            //if it turns out there isn't actually a remote resource, 

bail.
return false;
}

  •       //TODO: Implement local cache code            return true;  // 
    

Change this line return true instead of false*
}
return false;
}

Please let me know if any feedback

Thanks
Mul

··· On Thursday, 15 December 2016 21:40:20 UTC+5:30, Ethan Soergel wrote: > > Mul, > > That last error you showed usually means that celery (an asynchronous task > queue) is either not running or not connected. You can run that with this > command: > > $ ./manage.py celeryd --verbosity=2 --beat --statedb=celery.db --events > > Alternatively, you can force those tasks to run in the foreground by > setting `CELERY_ALWAYS_EAGER = True` in your localsettings.py file. This > is useful in development, but I wouldn't recommend it in production. > > - Ethan > > On Thu, Dec 15, 2016 at 10:46 AM, Mul Shanker <mulsh...@gmail.com > wrote: > >> Thanks Will >> >> This is great and thanks for quick reply >> >> Like you mention on reply I tried to click download and I am getting this >> error, note that I can see image on form but not Preview form, It seems we >> have miss some >> configuration , Alos please note that it works properly for cloudcare but >> not work for web app form preview. >> >> >> Thanks can you please help for the same >> >> >> >> >> >> On Thursday, 15 December 2016 18:43:47 UTC+5:30, William Pride wrote: >>> >>> Hey Mul, >>> >>> Great to hear you've gotten so far along with CommCareHQ and Formplayer. >>> >>> As you might've surmised that errors message occurs when your form >>> reference some multimedia that isn't available in the application. In this >>> case, the missing item looks to the be the image displayed in the form >>> select screen for the first form in the first module. When you view the >>> multimedia upload screen for this form what do you see? That screen should >>> be available here: >>> >>> [image: Inline image 1] >>> If that screen looks correct (IE an image looks to be successfully >>> uploaded) you can check that the image is being included correctly in the >>> multimedia on the deploy screen: >>> >>> [image: Inline image 2] >>> >>> If you download this zip file you should be able to unzip it and see an >>> image named module0_form0_en.png. If you can't I'd try re-deploying or >>> re-uploading the image. >>> >>> Cheers, >>> Will >>> >>> >>> On Thu, Dec 15, 2016 at 3:16 AM, Mul Shanker wrote: >>> >>>> >>>> >>>> HI All/Cory >>>> >>>> >>>> I setup commcarehq and formplayer as well xformplayer >>>> So far all working properly >>>> >>>> I am facing one issue when I create a form using feturedflag and "New >>>> Cloud Care" >>>> so this time it uses webapps to preview the form and Formplayer play >>>> form >>>> It work properly untill I added iconns or media >>>> >>>> As soon as I add icon it throw errors please see screenshot >>>> >>>> >>>> >>>> >>>> please see error log >>>> >>>> >>>> >>>> >>>> >>>> >>>> I am using folowing configuration >>>> >>>> Couchdb >>>> Postgres >>>> Elasticsaerch >>>> Kafka >>>> >>>> Please help me for the same. >>>> >>>> Thanks >>>> Mul >>>> >>>> -- >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "CommCare Developers" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to commcare-developers+unsubscribe@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CommCare Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-developers+unsubscribe@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > >

Mul,

Great to hear you've been able to work around this.

I'm not completely sure what's going on but what should be happening is
that the location's authority is local and so we never enter that latter
block. Seems like the descriptor for that multimedia file is being
generated differently, but I don't know what might cause that. I'm curious
whether the multimedia from your form is showing up on web apps?

Either way, if it works for you then stick with it :slight_smile:

Cheers,
Will

··· On Fri, Dec 16, 2016 at 10:17 AM, Mul Shanker wrote:

Thanks Ethan/William

We tried the celeryd, it was already look correct to me.

After that I debug code and found issue and fix it , after that form is
working properly

Below is details

Class name : BasicInstaller
Method name : install
This code always return false for RESOURCE_AUTHORITY_REMOTE, even incoming
is not null
I change code to return if incoming is not null becuase url is correct and
we get image from remote

@Override
public boolean install(Resource r, ResourceLocation location,
Reference ref, ResourceTable table, CommCarePlatform instance, boolean
upgrade) throws UnresolvedResourceException {
//If we have local resource authority, and the file exists,
things are golden. We can just use that file.

    if (location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL)

{

        try {
            //If the file isn't there, not much we can do about it.
            return ref.doesBinaryExist();
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        }
    } else if (location.getAuthority() == Resource.RESOURCE_AUTHORITY_

REMOTE) {

        //We need to download the resource, and store it locally.

Either in the cache
//(if no resource location is available) or in a local
reference if one exists.
InputStream incoming;
try {
incoming = ref.getStream();

        } catch (IOException e) {


            e.printStackTrace();
            return false;
        }
        if (incoming == null) {
            //if it turns out there isn't actually a remote resource,

bail.
return false;
}

  •       //TODO: Implement local cache code            return true;  //
    

Change this line return true instead of false*
}
return false;
}

Please let me know if any feedback

Thanks
Mul

On Thursday, 15 December 2016 21:40:20 UTC+5:30, Ethan Soergel wrote:

Mul,

That last error you showed usually means that celery (an asynchronous
task queue) is either not running or not connected. You can run that with
this command:

$ ./manage.py celeryd --verbosity=2 --beat --statedb=celery.db --events

Alternatively, you can force those tasks to run in the foreground by
setting CELERY_ALWAYS_EAGER = True in your localsettings.py file. This
is useful in development, but I wouldn't recommend it in production.

  • Ethan

On Thu, Dec 15, 2016 at 10:46 AM, Mul Shanker mulsh...@gmail.com wrote:

Thanks Will

This is great and thanks for quick reply

Like you mention on reply I tried to click download and I am getting
this error, note that I can see image on form but not Preview form, It
seems we have miss some
configuration , Alos please note that it works properly for cloudcare
but not work for web app form preview.

Thanks can you please help for the same

https://lh3.googleusercontent.com/-XMdTXx8HKbE/WFK6MfN97pI/AAAAAAAAAIQ/HF-Zfbp0V3AmqWcZMpHDy5gP73yLHv75QCLcB/s1600/error-2.png

On Thursday, 15 December 2016 18:43:47 UTC+5:30, William Pride wrote:

Hey Mul,

Great to hear you've gotten so far along with CommCareHQ and Formplayer.

As you might've surmised that errors message occurs when your form
reference some multimedia that isn't available in the application. In this
case, the missing item looks to the be the image displayed in the form
select screen for the first form in the first module. When you view the
multimedia upload screen for this form what do you see? That screen should
be available here:

[image: Inline image 1]
If that screen looks correct (IE an image looks to be successfully
uploaded) you can check that the image is being included correctly in the
multimedia on the deploy screen:

[image: Inline image 2]

If you download this zip file you should be able to unzip it and see an
image named module0_form0_en.png. If you can't I'd try re-deploying or
re-uploading the image.

Cheers,
Will

On Thu, Dec 15, 2016 at 3:16 AM, Mul Shanker mulsh...@gmail.com wrote:

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png
HI All/Cory

I setup commcarehq and formplayer as well xformplayer
So far all working properly

I am facing one issue when I create a form using feturedflag and "New
Cloud Care"
so this time it uses webapps to preview the form and Formplayer play
form
It work properly untill I added iconns or media

As soon as I add icon it throw errors please see screenshot

https://lh3.googleusercontent.com/-4Fm2gep8ZNs/WFJQtA2JWxI/AAAAAAAAAH0/jXetcAewFbYnYbbZ3MCmEMn2Cra7ytsUwCEw/s1600/error.png

please see error log

https://lh3.googleusercontent.com/-ur-aOMNLPjI/WFJRIT3kOYI/AAAAAAAAAH4/UKYWxpJ4oVYGpOTW1TNyFaRzguUh7AjzwCLcB/s1600/log.png

I am using folowing configuration

Couchdb
Postgres
Elasticsaerch
Kafka

Please help me for the same.

Thanks
Mul

--


You received this message because you are subscribed to the Google
Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--


You received this message because you are subscribed to the Google
Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

--


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.