1 of 2
1
Questions about application patching
Posted: 03 October 2009 03:05 PM   [ Ignore ]
Newbie
Avatar
Rank
Total Posts:  26
Joined  2009-02-22

I just read the article posted by Numerex titled “Updating Your FAST Application with the Latest Release (via patch file)”.

First, thanks for posting that - this is extremely helpful information.

Second, is there a published list of available patches anywhere (including their URLs)? I’d like to be able to see whats available and download them.

Finally, what’s the best way to find out what “version” or release number our application is currently on? Is that just the SVN build number (I’m assuming not, since we’re able to make our own modifications and check them in)?

Thanks in advance,
Scott L.

Profile
 
 
Posted: 07 October 2009 12:06 PM   [ Ignore ]   [ # 1 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

We just started introducing the patch format so there’s nothing else currently published. From here on out we’re planning on publishing them in the dev blog. You maybe be able to request this by sending an email to (JavaScript must be enabled to view this email address) but I’m not sure how difficult it will be to generate the patch file. Another option would be to download the project from GitHub and then do a diff on it with yours. Probably not the most elegant solution. Our plans are to publish new builds a few times a month and there should be a new one available next week.

Profile
 
 
Posted: 08 October 2009 07:16 AM   [ Ignore ]   [ # 2 ]
Newbie
Avatar
Rank
Total Posts:  26
Joined  2009-02-22

Understood - thanks for the clarification.

I asked that question because I have seen a few posts on the forums here that refer to “upgrades” or “latest builds” or even features that have been developed but not actually released to all FAST clients.

For example, in this post: http://dev.numerex.com/forums/viewthread/118/

The poster describes that the latest build has updates to admin pages, etc. Are those updates something that Numerex developed? If so, were they pushed to all client SVN repositories automatically?

I’m just trying to avoid development efforts on our end that may overlap with something that Numerex is already done with or has in the works.

Thanks,
Scott

Profile
 
 
Posted: 09 October 2009 05:08 PM   [ Ignore ]   [ # 3 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

Scott,

Thanks for the note. Yes, the updates were developed by us as part of the core software. However, we do not automatically install updates to customer servers unless they are working with our professional services team. In the case that you’re doing your own development (as the poster you mentioned is) then you’ll have access to our latest build and patch files to do this yourself. Please let us know if you have any other questions.

Thanks,
Dennis

Profile
 
 
Posted: 11 October 2009 02:05 PM   [ Ignore ]   [ # 4 ]
Newbie
Avatar
Rank
Total Posts:  26
Joined  2009-02-22

Thanks Dennis.

I guess the question we have is this: since we do our own development, can Numerex tell us what the differences are between the version we have and the “current version”?

Thanks,
Scott

Profile
 
 
Posted: 14 October 2009 07:16 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  15
Joined  2009-09-26

I attempted to apply the 9502 patch using TortoiseSVN, but in every instance it gave me an error
that says ‘Patch seems outdated’ and that the lines of code do not match. I have only applied minor
customizations to our app.

Profile
 
 
Posted: 14 October 2009 11:49 AM   [ Ignore ]   [ # 6 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

We may be able to address both these issues with an article that talks through the process. Let me see if we can get something published tomorrow. Check the Dev Exchange and I’ll post an link here as well.

Profile
 
 
Posted: 21 October 2009 03:35 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  6
Joined  2009-10-14

I have several questions about patch fast_tracking_9502.diff Numerex recently provided.

1) I managed to apply the patch to the most part of the project. But there were 5 files that have not been patched and patch command gave the following results on that files:

patching file lib/daemons/notifier.rb
Hunk 
#1 FAILED at 3.
Hunk #2 FAILED at 19.
2 out of 2 hunks FAILED -- saving rejects to file lib/daemons/notifier.rb.rej 

Four other files are db/schema.rb, config/database.yml, config/environments/test.rb, config/environments/development.rb. I had to do the modifications specified in .diff file manually to those files. But what do those errors mean?

2) After applying the patch and manual modifications I tried to call rake db:migrate. It failed with the following error:

Missing these required gems:
  
binarylogic-searchlogic  >= 2.2.3
  mislav
-will_paginate  >= 2.3.11 

I discovered the following lines were added to environment.db with the patch:

config.gem 'binarylogic-searchlogic',
    :
lib => 'searchlogic',
    :
version => '>= 2.2.3',
    :
source => 'http://gems.github.com'
  
config.gem 'mislav-will_paginate',
    :
lib => 'will_paginate',
    :
version => '>= 2.3.11',
    :
source => 'http://gems.github.com' 

I tried to install those gems:

gem install searchlogic... Successfully installed searchlogic-2.3.5
gem install will_paginate
... Successfully installed will_paginate-2.2.2 

But error was still there. And rake db:migrate worked only after I commented those new lines in environment.db. What is the correct way to handle this issue?

3) After I started the server and tried to login to my local test account I got the following error in browser:

uninitialized constant Device::GeofenceViolation

C
:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2199:in 
`compute_type'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2195:in `compute_type'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:156:in 
`send'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:156:in `klass'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:187:in `quoted_table_name'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1413:in 
`configure_dependency_for_has_many'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:823:in `has_many'
(eval):3:in `has_many'
%PROJECT_PATH%/app/models/device.rb:31
%PROJECT_PATH%/app/controllers/home_controller.rb:6:in 
`index 

, where %PROJECT_PATH% is the path to the project on the local drive. device.rb:31 is the following:

has_many :geofence_violations, :order => "geofence_id ASC", :dependent => :destroy, :conditions => 'EXISTS(SELECT * FROM geofences WHERE geofences.id = geofence_id)' 

But there is no GeofenceViolation model, it wasn’t added by the patch. So I added it manually, restarted server and it helped. So the question is - where is GeofenceViolation model? smile

Profile
 
 
Posted: 21 October 2009 05:44 AM   [ Ignore ]   [ # 8 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

You’re really getting into this! First off, thanks for your patience and detailed post information. Let me try to address your issues one by one:

1. Can you post your notifier.rb.rej file? You can either down it inline or as an attachment. I’d like to see what’s going on.

2. Generally to install gems you would run rake gems:install

3. Unfortunately this was added after the patch file was published. You did the right thing and just as a reference the contents of the file should look like:

class GeofenceViolation < ActiveRecord::Base
  belongs_to :device
  belongs_to :geofence
end

Sorry for any inconvenience.

Profile
 
 
Posted: 21 October 2009 09:20 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  6
Joined  2009-10-14

Thanks for the reply!

1. Here is the notifier.rb.rej file contents (forum didn’t allowed me to attach the file and said: “The filetype you are attempting to upload is not allowed. Allowed Filetypes: image”):

***************
*** 
3,11 ****
  
# Load EngineYard config
  
if File.exist?("/data/ublip/shared/config/mongrel_cluster.yml")
    
mongrel_cluster "/data/ublip/shared/config/mongrel_cluster.yml"
# Load Slicehost config
  
else
    
mongrel_cluster "/opt/ublip/rails/shared/config/mongrel_cluster.yml"
  
end
  
  
# Load the env from mongrel_cluster
--- 3,11 ----
  
# Load EngineYard config
  
if File.exist?("/data/ublip/shared/config/mongrel_cluster.yml")
    
mongrel_cluster "/data/ublip/shared/config/mongrel_cluster.yml"
  
else
    
mongrel_cluster "/opt/ublip/rails/shared/config/mongrel_cluster.yml"
+   Dir.chdir("/opt/ublip/rails/current"# For Rails 2.3.2 compat
  
end
  
  
# Load the env from mongrel_cluster
***************
*** 
19,28 ****
    
$running false
  end
  
  
while($running) do
-   
-   
logger ActiveRecord::Base.logger
-   logger.auto_flushing true
    logger
.info("This notification daemon is still running at #{Time.now}.\n")
  
    
NotificationState.instance.begin_reading_bounds
--- 19,28 ----
    
$running false
  end
  
logger Logger.new(File.join(RAILS_ROOT,'log','notifier.rb.log'), 'weekly')

  while(
$running) do

    
logger.info("This notification daemon is still running at #{Time.now}.\n")
  
    
NotificationState.instance.begin_reading_bounds 

2. Thanks for the tip, it helped! I’ve just started with Rails so don’t know much yet smile

3. Thanks.

Profile
 
 
Posted: 03 November 2009 06:06 PM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  7
Joined  2009-05-27

I also applied the patch to our app. Unfortunately, I got lot of failures and rejects. I think our app is far behind the current version.
So I was wonder what is the best way to upgrade to the latest build?
Here is my though
1. Manually resolve these fail and rejects one by one.  There are might be more differences to resolve manually like db migrate, plugin….
2. Use the latest build as base, carry over the changes we made to the app. Then I figure out that the latest build is rails 2.3.2. Our app is still 2.1.0. This means the staging and production will require to upgrade to latest rails as well…

What’s the best choice? Any feedback is welcome!

Profile
 
 
Posted: 04 November 2009 09:14 AM   [ Ignore ]   [ # 11 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

Great questions. Sometimes we wish there was a magic button that you could click to have your changes easily merged with core. With that being said, if you haven’t made a whole lot of customizations then I would say option #2 is the way to go. If you’re still on Rails 2.1 then it would be easy to coordinate an upgrade with our support team to get you the latest version of the app. Your staging and production servers already have the latest versions of Rails. We manage this across all our VMs to keep them consistent. I would recommend running the latest version of the app on your local machine to become more familiar with the additions. You can download it here:

http://github.com/numerex/FAST_CORE_Tracking

I hope this helps.

Profile
 
 
Posted: 05 November 2009 08:59 AM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  7
Joined  2009-05-27

Thanks for the reply. #2 is the approach that I am taking.

Profile
 
 
Posted: 05 November 2009 09:03 AM   [ Ignore ]   [ # 13 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

Great. Good luck and keep us posted. We want to find ways to make this process easier in the future and appreciate any feedback.

Profile
 
 
Posted: 10 December 2009 05:50 AM   [ Ignore ]   [ # 14 ]
Newbie
Rank
Total Posts:  13
Joined  2009-11-05

Just an update about our app upgrade progress. We took the latest release from github, migrate the customized changes we made to the new app. The first issue we ran into is the New_Relic plugin. After some digging, we upgraded the new_relic to the latest version, that fixed the issue. Why the latest build come with old version new_relic 2.3.4?  I don’t think it work with rails 2.3.2

Everything work fine except the admin/device. The error is
    app/models/device.rb:105:in `gateway_device’
  vendor/plugins/fast_admin/app/controllers/admin/devices_controller.rb:11:in `device_imei_or_link’

Any feedback is welcome!

Profile
 
 
Posted: 14 December 2009 08:47 AM   [ Ignore ]   [ # 15 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

Would you mind posting more of your error message so we can help troubleshoot? Thanks.

Profile
 
 
   
1 of 2
1