Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloading app error #5417

Closed
omiltoro opened this issue Feb 3, 2015 · 43 comments
Closed

downloading app error #5417

omiltoro opened this issue Feb 3, 2015 · 43 comments
Assignees

Comments

@omiltoro
Copy link

omiltoro commented Feb 3, 2015

Hi Everyone,

I am not able to download the artifacts from teamcity kindly assist.

I am getting the following error.

Unexpected Error

This was not supposed to happen. Please provide the error details to your TeamCity server maintainer.
If you maintain this TeamCity installation please report this error to JetBrains.

Error message: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: javax.servlet.ServletException: java.lang.ClassFormatError: Truncated class file

@czue
Copy link
Member

czue commented Feb 3, 2015

There is a new build server where you should download artifacts from. @wpride can point you where you can find that.

@omiltoro
Copy link
Author

omiltoro commented Feb 3, 2015

Thank you @czue . That was prompt. It would be prudent to update the documentations too.

@czue
Copy link
Member

czue commented Feb 3, 2015

yep, we're in the process of finishing moving everything over, but will definitely update documentation as soon as it's finished.

@omiltoro
Copy link
Author

omiltoro commented Feb 3, 2015

@wpride kindly assist at your earliest convinience

@omiltoro
Copy link
Author

omiltoro commented Feb 3, 2015

@czue is @wpride reachable?

@czue
Copy link
Member

czue commented Feb 3, 2015

he's on the east coast of the US so probably will be online in the next couple hours.

@wpride
Copy link

wpride commented Feb 3, 2015

@omiltoro please refer here http://jenkins.dimagi.com/view/CommCare%20Mobile/ to find the authoritative artifacts from here on

@omiltoro
Copy link
Author

omiltoro commented Feb 4, 2015

Thanks very much @wpride

@omiltoro
Copy link
Author

omiltoro commented Feb 4, 2015

@czue i managed to add the app builds to commcarehq as follows

(commcare-hq)patrick@patrick-PowerEdge-T100:/Downloads/commcare-hq$ python manage.py add_commcare_build /home/patrick/Downloads/archive/app/dist/commcare-odk.apk 2.0.0 352782
2015-02-04 07:01:46,275 INFO Raven is not configured (disabled). Please see documentation for more information.
Build 2.0.0 #352782 created
You can see a list of builds at [your-server]/builds/
(commcare-hq)patrick@patrick-PowerEdge-T100:
/Downloads/commcare-hq$

However I'm not able to deploy the app with the following message

ResourceNotFound: Document is missing attachment
[04/Feb/2015 06:59:20] "POST /a/cafarmerscops/apps/save/655286222b0a55969509066c22b4c9d6/ HTTP/1.1" 500 51354

@czue
Copy link
Member

czue commented Feb 4, 2015

@omiltoro can you provide a complete stack trace?

@omiltoro
Copy link
Author

omiltoro commented Feb 4, 2015

@czue link to pastebin http://pastebin.com/xAygpCqu

@czue
Copy link
Member

czue commented Feb 4, 2015

It does look like the file wasn't uploaded properly (or perhaps there's some other error going on). @dimagi/team-commcare-hq and @wpride might have to look closer to come up with a solution.

@omiltoro
Copy link
Author

omiltoro commented Feb 4, 2015

@czue do we load the apps when the virtual environment is active?

@dannyroberts
Copy link
Member

@omiltoro I don't understand your last question. If you navigate to /builds/edit_menu/, make sure you've added your newly uploaded version to that list, which represents the versions available to choose from when you build an app.

  • if you version isn't available in the dropdown at /builds/edit_menu/, then follow the instructions at the bottom to add it

Then navigate to your application and make sure that your new version is selected as the CommCare Version (under General Settings, on the app's settings page).

Let me know whether you are still seeing the same stack trace after you've confirmed all of these steps.

@wpride
Copy link

wpride commented Feb 5, 2015

@omiltoro please see updated documentation. Sorry for the inconvenience.

@czue czue closed this as completed Feb 6, 2015
@omiltoro
Copy link
Author

omiltoro commented Feb 6, 2015

thank you all. Could someone help with a simple short webcast on building apps. @czue @wpride @dannyroberts it would really help

@dannyroberts
Copy link
Member

@omiltoro Thanks for your suggestion. Passing on to @amsagoff. Glad we could help you work through the issue you were experiencing!

@omiltoro
Copy link
Author

Im still waiting for the link @amsagoff

@omiltoro
Copy link
Author

@wpride @dannyroberts im still getting the same error

@wpride
Copy link

wpride commented Feb 11, 2015

@omiltoro have you cleared out the old builds? You will need to delete any builds with the old (unsupported) .zip structure from your couch DB

@omiltoro
Copy link
Author

@wpride i did a re-installation of commcare and now still receiving the same error may be a small video could really save me .

@wpride
Copy link

wpride commented Feb 12, 2015

@omiltoro Can you confirm that you cleared the old builds out of couchdb?

@omiltoro
Copy link
Author

@wpride i did a fresh installation on another pc.

On Thu, Feb 12, 2015 at 6:11 PM, wpride notifications@github.com wrote:

@omiltoro https://github.com/omiltoro Can you confirm that you cleared
the old builds out of couchdb?


Reply to this email directly or view it on GitHub
#5417 (comment).

Systems Developer/Programmer
Snapshot Cv:http://kinzaa.com/omiltoro
Github:www.github.com/omiltoro
Mobile : 0722142396
+254722142

Keep it SMART

We can not do great things. We can only do little things with great love. --
Mother Teresa
http://www.quotemountain.com/fullsearch.php?searchtxt=Mother+Teresa&matching=3
Call
Send SMS
Add to Skype
You'll need Skype CreditFree via Skype

@omiltoro
Copy link
Author

could someone assist please @wpride

@NoahCarnahan
Copy link
Contributor

@omiltoro

Step 1, Clear out old builds
  • Start couch db if it's not already running.
  • Navigate to http://127.0.0.1:5984/_utils/database.html?commcarehq/_design/builds/_view/all in a web browser. You will need to change the 127.0.0.1:5984 part of the url if couch db is running at a different location.
  • You should now see a list of documents in the database. You want to delete all of the documents who's "key" starts with "2.19" (for example, the last two rows in the attached screenshot). Delete rows by clicking on the row, then clicking the "Delete Document…" button that will apear on the document's page. (Don't ever click "Delete Database…", which appears in the same spot on some other pages).
Step 2, Re-upload the build
  • Make sure HQ is running on your machine.
  • Navigate to http://192.168.1.14:8000/builds/edit_menu/. You will probably have to adjust the 192.168.1.14:8000 to match the address and port that you are running the server on.
  • In the form at the bottom of the page enter the following information:
    • Source for artifacts.zip: http://jenkins.dimagi.com/view/CommCare%20Mobile/job/commcare-mobile-2.19/346003/artifact/application/posttmp/artifacts.zip
    • Version: 2.19.0
    • build number: 346003
  • Click the "Import build" button. This might take a moment to process.
  • Then, add a 2.19.0 item to the "Menu Options" list at the top of the builds/edit_menu/ page. Click the "Submit" button once you've added it to the list.

I think this is all the steps. Let me know if you run into any problems.

screen shot 2015-02-19 at 11 48 05 am

@omiltoro
Copy link
Author

thanks @NoahCarnahan i will try your approach

@omiltoro
Copy link
Author

@NoahCarnahan when i navigate to myserver:8000/builds/edit_menu/

I receive a 403 error i do not have permission

[19/Feb/2015 11:05:54] "GET /no_permissions/?next=/builds/edit_menu/ HTTP/1.1" 403 14572

@NoahCarnahan
Copy link
Contributor

@omiltoro, are you signed in? If you are and you continue to get that error you will need to make your account a superuser account.
You can do that on the command line where you launch hq from. Run the command:

python manage.py createsuperuser

That will run you through an interactive prompt for setting the username and password and such.

@omiltoro
Copy link
Author

@NoahCarnahan was able to add the build successfully but im still receiving this error
KeyError: "Can't find build 2.0.0/latest. For instructions on how to add it, see https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/builds/README.md"

see complete stack trace http://pastebin.com/eQtBiHcQ

@omiltoro
Copy link
Author

Hi @czue @NoahCarnahan i managed to build an app had to delete the old builds and recreate a new app in commcare.

@czue
Copy link
Member

czue commented Feb 25, 2015

glad to hear it!

@omiltoro
Copy link
Author

@czue @NoahCarnahan i believe someone must have reported this issue im facing at the moment. I am not able to sync forms to the commcarehq

ERROR Status code 400 for a form submission. Response is:
Content-Type: text/html; charset=utf-8

If you use multipart/form-data, please name your file xml_submission_file.
You may also do a normal (non-multipart) post with the xml submission as the request body instead.

could you point what i might have not done on my local setup

@czue
Copy link
Member

czue commented Feb 26, 2015

@omiltoro - in order to submit from a phone you need to use a proxy server configured to support chunked encoding. There are sample nginx and apache config files you can start from in the repository.

@omiltoro
Copy link
Author

omiltoro commented Mar 2, 2015

@czue @dannyroberts is this the link to the config files https://github.com/dimagi/commcare-hq/blob/master/deployment/apache/local_apache.conf

Another question? How do i add these to my setup. Ive tried editing the apache2 config file and nothing seems to change. Could some one guide?

@NoahCarnahan
Copy link
Contributor

@omiltoro , you need to place that file in a special location on your computer, and then start apache with a command like apachectl start or apachectl restart
I'm not sure if windows usually comes preinstalled with Apache, in which case you should probably follow the directions here: http://httpd.apache.org/docs/2.4/platform/windows.html . It looks like that page also talks about .conf files and where they should be located, so once you determine if Apache is installed or not, you can start looking at the existing .conf files.

On my machine, there is an apache configuration file at /etc/apache2/httpd.conf. The last line of that file reads: Include /private/etc/apache2/other/*.conf, which means "include all of the configurations specified in files in the /private/etc/apache2/other/ directory that end with .conf. So, when I set up my environment I placed a copy of the file you linked at /private/etc/apache2/other/cchq.conf.
Note though that your paths will be different because you are using a different operating system.
I believe Clayton is on a Windows machine, so he may be able to help with Windows specific questions.

@omiltoro
Copy link
Author

omiltoro commented Mar 2, 2015

@NoahCarnahan thanks im setting up on ubuntu 12.0.4

@NoahCarnahan
Copy link
Contributor

Ah ok, that will make it easier. I'm on OSX, but I imagine a google search
for "ubuntu apache conf" will turn up some good clues as to where to put
the configuration file.

On Mon, Mar 2, 2015 at 11:56 AM, Patrick notifications@github.com wrote:

@NoahCarnahan https://github.com/NoahCarnahan thanks im setting up on
ubuntu 12.0.4


Reply to this email directly or view it on GitHub
#5417 (comment).

@omiltoro
Copy link
Author

omiltoro commented Mar 2, 2015

it seems my httpd.conf file is blank @NoahCarnahan

@omiltoro
Copy link
Author

omiltoro commented Mar 2, 2015

@NoahCarnahan @czue i added the file to the conf.d directory as directed by this site http://www.control-escape.com/web/configuring-apache2-debian.html but still getting the errors

@snopoke
Copy link
Contributor

snopoke commented Mar 2, 2015

Hi Patrick

You should add the file to the the /etc/apache2/sites-available folder.
You can then run the command (assuming the file you copied is called
cchq.conf):

$ sudo a2dissite 000-default.conf
$ sudo a2ensite cchq.conf

This will disable the default apache config and enable your one.

You need to make sure your local commcare instance is running on port 8000
(which is the default django port) and you should also set the
BASE_ADDRESS setting in your localsettings.py file to be equal to your
machine's IP address e.g. BASE_ADDRESS = '192.168.0.4'

Having done that you'll need to make a new build of your app so that it
points to the correct URL's (using the correct base address). You should
then be able to install the app to your phone and submit data.

@omiltoro
Copy link
Author

omiltoro commented Mar 2, 2015

@snopoke your method does not work for me

@snopoke
Copy link
Contributor

snopoke commented Mar 2, 2015

Perhaps we should move this from the PR to the commcare-developers group: https://groups.google.com/forum/#!forum/commcare-developers

@omiltoro
Copy link
Author

omiltoro commented Mar 3, 2015

@wpride @czue ideas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants