Open allthesignals opened 9 years ago
Hi all, Some changes were made in these commits: 2d79fb8e957db999c7b5478c844ad389d53876ce 2c63dc72987d15326ca502bce4edcda946d6da5a
Is it possible for you to pull these into production, @demiurg? If not, do you have a process for this setup in production, or does it need to be done manually?
Thanks!
Matt
It's possible, and is manual. However, these commits are on a development branch. In general, so far with this project, master is the production branch. To pull something to production I would merge and test, before pulling on production. Is that a task?
I will be happy to merge them into master, but as I cannot get the app running locally, I have not been able to test and was hesitant to merge development changes into master.
On Sun, Feb 8, 2015 at 1:07 PM, Pavel notifications@github.com wrote:
It's possible, and is manual. However, these commits are on a development branch. In general, to me, master is the production branch. To pull something to production I would merge and test, before pulling on production. Is that a task?
— Reply to this email directly or view it on GitHub https://github.com/MAPC/myschoolcommute/issues/76#issuecomment-73422979.
Matt Gardner M.S. Urban and Regional Policy Candidate School of Public Policy and Urban Affairs Northeastern University
@demiurg Let me see if I can get the app running locally in a Vagrant box. Then I could test it and do this myself. This was part of the first task in the task order we sent out. Thanks!
Ok, that makes sense. I didn't want to assume anything. For getting a test site I suggest using a dump of the production database, because it has a unique combination of processed geospatial data time consuming to recreate.
@demiurg Thanks for the response - that's a good idea. I'll try to run python manage.py dumpdata
on it, although I believe I have to be logged in as the django
user on the production server. It'd be nice to "fixturize" the data for development purposes. Alternatively, I will just do a pg_dump and try to restore that locally.
Unfortunately I don't think it's possible to fixture the type of GIS data that the site relies on, because it is topography and other spatial data relationships that no one has really worked on exporting to text form, let alone json. I suggest pg_dump -Fc and before import, pgrouting and postgis extensions should be installed, preferably of the same version as on the server.
@demiurg Hi Pavel. I was able to test the templates, and I merged them into master, along with the R changes.
Separately, I am locally seeing column survey_school.shed_05 does not exist
so I wondered if the database restoration was incomplete. It sounds like walkshed generation didn't transfer over correctly, but I couldn't be sure. There is nothing in the pg_restore's error log about it. Additionally, grep
ing the sql dump for some reference to the column returns nothing.
Thanks.
That seems very odd. One thing that might have prevented the sheds from importing is not having SRID '26986' in the spatial_ref_sys or proj4 epsg file. This is a MA local projection. If it's not present, the column datatype would not have been valid, but that should have generated an error somewhere.
@demiurg Interesting - in the production database, \d survey_school
does not show a shed_05
column either. I can only think that somehow I'm dumping the wrong database (although local_settings.py
points to the right database), or I'm using a version of the Django app that differs from the production version. Checking git log
on the production server shows the last commit was in 2011, so it's definitely a different version, although it may not somehow be version controlled. Not sure! Thanks for any insight you are able to provide.
You could be in wrong directory/database. Directory is: /var/www/saferoutes/myschoolcommute
Database is 'mysc', and mysc=# \d survey_school ... shed_05 | geometry(MultiPolygon,26986) |
@demiurg Great. I am up and running. Thanks.
08b6236dfadbdcc3894b39551d4b41d4a63d2bee, and the branch merge a036b360b7c34099113dfdf233d05842e6dc84a1 resolves this issue.
@demiurg Hi Pavel. Thanks again for your help. One of the tasks includes pulling changes into production. Would you be able to do this after pulling my changes into your local copy and testing the report generation and batch template's map toggle functionalities? As I mentioned, these changes work on my local copy, but I'd be more comfortable if you could test them as well and push them to production. Is there anything I can do to help you accomplish this?
Thanks!
Yes, I should be able to test and pull on production thereby testing our test and production environments :)
Matt has committed and merged a number of changes to the master branch; tested locally and ready to be pulled into production. Please pull these changes ASAP. Thanks!
@demiurg Hi Pavel - I just wanted to check on the status of this issue. Let me know if there are any issues that I can help with. Thanks again!
Sadly, I'm getting errors related to R: Error: 'rho' must be an environment not NULL: detected in C-level eval * stack smashing detected *: /web/myschoolcommute/venv/bin/python terminated Aborted (core dumped)
There is a chance things might work in production, I can pull there, test, and revert if the issue persists.
@demiurg Hmm can you provide some more context? Is this happening when you run the server? What version of R is being used on the production server? That sounds like maybe an issue with R versions, if you've updated R on your development environment.
Also, I updated an .RData workspace image file because that was how the scripts had been retrieving some data in the past. This is most likely worth refactoring, but that may be related to the issue. I included a backup of the old R/.RData.backup
. Try seeing if that using that resolves the issue.
From what I've found, this is related to how the python package rpy2 interacts with R itself - usually it's a version mismatch. http://sourceforge.net/p/rpy/mailman/rpy-list/thread/5246F9F1.4090108@gmail.com/. It shouldn't be the RData image file. It's not specified in the requirements.txt, so a pip install -r requirements.txt
should cause problems on production.
I'm looking into building rpy2 2.3.8 but I think I need to install some package with headers. These are not easy to find given the name of the r package.
Ok, so rpy2 is fixed by apt-get installing r-base r-base-core r-base-dev and pip installing rpy2==2.3.8. More errors to look into.
Sounds good. Let me know what issues you run into. If R wasn't installed, I've found that there are some required R packages beyond those listed in the README. Here is the output of my installed.packages(), for reference: https://gist.github.com/allthesignals/881aa68c36a868cf33b4
Additionally, apt-get install texlive-binaries
will install what you need for LaTex, if you don't have that already.
@demiurg I noticed the accessibility changes have been pulled into production - thanks! I'm seeing a 502 Bad Gateway for the report generation, however. What is the output of the logs? Thanks.
Nevermind :) Report-generation seems to be working fine. Thanks again, Pavel.
It's not working, as in off and on. Something is going on with the email system. sendmail is apparently blocking.
----- The following addresses had permanent fatal errors ----- admin@masaferoutessurvey.org (reason: 550 5.7.1 Your email messages have been blocked by the recipient OR by Trend Micro Email Reputation Service. Contact the recipient or his/her administrator using alternate means to resolve the issue.)
----- Transcript of session follows ----- ... while talking to mail.mapc.org.:
DATA <<< 550 5.7.1 Your email messages have been blocked by the recipient OR by Trend Micro Email Reputation Service. Contact the recipient or his/her administrator using alternate means to resolve the issue. 550 5.1.1 admin@masaferoutessurvey.org... User unknown
This could be bad for any other site on the server as well. In this case, I think the best solution is not to mess with domain records and close ports (8000 is open for some reason which might be one of any random cause for security software to flag the sender as spam host), but to have a valid SMTP server with which django project can be configured. I have used gmail apps in the past, but I'm not sure what is best for MAPC. Basically, the masaferoutessurvey.org MX records need to match the email senders info.
@demiurg Hmm - I think our web developer @beechnut has set up our SMTP server with another app before, so we can look into it. I know there were a lot of pain points. Using google apps might be a good temporary solution.
I'm currently seeing production behaving as expected - are you experiencing downtime only intermittently?
Thanks for your help!
The error seems to happen at a whim of the remote remote relay not accepting the email. It's not happening now, but the error "blocked by the recipient OR by Trend Micro Email Reputation Service." doesn't really indicate why. I was simply trying to test when it started working, so I believe whatever the underlying problem was, did not go away.
Hey @demiurg, we fixed an issue with the R files. I committed those changes to master. Could you pull those into production? Also, if you have some time, could you document your guidelines for pull code changes into production (just so that I don't have to bug you to do it). I'm hesitant to do it myself because I'm not sure if there are any custom task scripts involved.
Thanks!
git pull sudo service saferoutes restart
That's all I typically do, and of course I check that whatever is pulled works. Just pulled.
MAPC will push changes to this Github repo. These changes should be pulled into the repo on the production server and the the app should be restarted to reflect those changes.
Templates: https://github.com/MAPC/myschoolcommute/tree/master/survey/templates R files: https://github.com/MAPC/myschoolcommute/tree/master/R