Giter Site home page Giter Site logo

web's Introduction

Squash: A squarish bug spray

An open-source project from Square

Squash is a collection of tools that help engineers find and kill bugs in their code by automatically collecting, collating and analyzing run time exceptions. Squash consists of the following components:

  • Client libraries: Client libraries for different systems (Ruby, Ruby on Rails, Cocoa with Objective-C, etc.) catch and record errors when they occur, then send them to the API endpoint. Client libraries can be found under the SquareSquash organization.
  • Front-end: This website displays Bug information and helps the engineer find the root cause for a Bug, and fix it. It also lets engineers manage, assign, and comment on Bugs, as well as view statistics about the Bug.
  • API endpoints: These routes (part of the front-end app) receive exception notifications from the client libraries and process them.

This project is the front-end and the API.

Pull requests are more than welcome; please check out CONTRIBUTING.md for details.

How to Install

To get started, run the bin/setup file. This script will ask you a series of questions and generate a preliminary configuration for your site install. When the script is completed, you can run git status to see what files it changed, and refine your configuration from there.

Once the script is complete, Squash should run for most typical development environments. Simply run rails s and visit the site in your Web browser. You should be able to start using it immediately. You can also verify correctness by running rspec spec.

Configuring and deploying the production instance is entirely up to you and your particular production environment.

Additional configuration options can be found in the following locations:

  • config/application.rb
  • config/environments/*.rb
  • config/environments/*/*.yml

If you don't see what you're looking for in any of those files, you'll probably have to change the code to make it work. Don't be afraid -- the code is thoroughly documented and should (hopefully) be very accessible.

Requirements

Squash requires the following:

  • Ruby 1.9.2 or newer (JRuby with --1.9 is supported)
  • Multithreading support (see the next section)
  • PostgreSQL 9.1 or newer
  • The Bundler gem
  • Git 1.7 or newer

Notes on some of the gem and library choices

Why do you specifically require PostgreSQL? Squash uses a lot of PostgreSQL-specific features to make efficient use of the database and maintain referential integrity, such as:

  • foreign key constraints,
  • triggered cached counters,
  • check constraints, and
  • semantic indexes for text-based search.

If PostgreSQL is out of the question, some of these features can be ported to other RDBMSes; simply edit the InitialSchema migration and update the SQL as necessary. If portability is required, a lot of these features can be reimplemented in the Rails layer (e.g., cached counters), at the risk of degraded referential integrity. (If you are reimplementing the cached counters in Ruby, be sure to modify the config/initializers/active_record.rb file as appropriate.)

If you do successfully port Squash to another RDBMS, let me know. I'd be happy to take your changes.

Why do you bundle an edge version of Rails? The 3-2-stable branch of Ruby on Rails includes some changes to Active Record that are required by Squash's multithreaded concurrency model (see next question). In particular, that version of Active Record includes crucial changes to the connection pool and connection reopening logic. If you set the background_runner option in the concurrency.yml file to something other than Multithread, the Gemfile will automatically drop Rails back down to the latest release version.

Why don't you use my favorite backgrounding library? Squash was originally built for Square, which runs all its services on JRuby. Using threads is very efficient in JRuby, and avoids the overhead of having to deploy both a website and workers.

If you are running Squash in a non-thread-safe (or multithreading-unfriendly) environment, you can use Sidekiq or Resque instead. If you want to use some other backgrounding library, you can easily write your own adapter. All threaded code is invoked using {BackgroundRunner.run}, which then uses the settings in the concurrency.yml Configoro file to invoke the correct module under lib/background_runner. The default is to use {BackgroundRunner::Multithread}, which uses the {Multithread} module to execute the task in its own thread. You can edit the YAML file and switch the background runner to Resque, or implement your own BackgroundRunner module. See the {BackgroundRunner} documentation for more details.

If you do this successfully and wish to save future Squash users the effort, feel free to turn your changes into a pull request.

Why aren't you using RedCarpet? As mentioned above, Squash was originally built to run under JRuby. RedCarpet has compiled C extensions; Kramdown is pure Ruby.

Why do you require a recent version of Git? Squash uses the git clone --mirror command to create local mirrors of client projects' Git repositories.

Why don't you have integration tests or acceptance tests? To be 100% honest, lack of familiarity on these things in Ruby/Rails. Happy for any help people want to extend towards this goal.

Why are you using Erector? I like Erector.

Documentation

Comprehensive documentation is written in YARD- and Markdown-formatted comments throughout the source. To view this documentation as an HTML site, run rake yard.

CoffeeScript libraries are documented using the YARD format as well, but YARD does not as yet recognize them as documentable files. A .codoopts file is included in case you wish to use Codo to generate the CoffeeScript docs, but as of now Codo does not recognize the ERb files, and does not use the full set of Markdown syntax features used in the documentation.

Project Overview

Views

This is a pretty typical Rails website, save for the views, which are written using Erector. The views forgo the traditional Rails concepts of partials and templates in favor of analogous OOP concepts more familiar to software developers: methods and inheritance. All views inherit from an abstract Erector widget which provides layout; and all views have their content split into multiple private methods.

In addition to the usual helpers (in app/helpers), there are view mixins under app/views/additions that simplify view coding.

Embedded code snippets are all rendered using the {CommitsController#context} action. This action loads the appropriate file and revision from the Git repository and returns a snippet plus the name of the SyntaxHighlighter brush to use. The brush is determined from the file name/extension; the mapping can be found in data/brushes.yml.

This view behavior is provided from a JavaScript library file in lib/assets/javascripts. There are many similar helper classes in there; they are documented but the documentation is not recognized by YARD and so is not included in this documentation set.

JavaScript files are organized into four possible locations:

  • Third-party JavaScript libraries are in vendor/assets/javascripts and loaded in the application.js manifest.
  • JavaScript modules or helpers that are not specific to a particular page or site area are in lib/assets/javascripts and also loaded in application.js.
  • JavaScript modules or helpers specific to a particular area of the site are in app/assets/javascripts and also loaded in application.js.
  • Small JavaScript snippets, glue code, or other code intended to add dynamic behavior to a specific page is in a .js file named the same as, and placed alongside, the .html.rb view file. For example, if app/views/projects/new.html.rb needed a bit of JS glue code, it would be placed in app/views/projects/new.js. This code is placed in a <SCRIPT> tag at the end of the view by the {Views::Layouts::Application#inline_javascript} method.

CSS files are similarly organized:

  • Third-party CSS files are in vendor/assets/stylesheets and loaded in the application.css manifest.
  • CSS styles or helpers global to the entire website are in lib/assets/stylesheets and also loaded in application.css.
  • CSS styles specific to a single page or a related group of pages are placed in app/assets/stylesheets and also loaded in application.css. Each <BODY> tag is given a class name equal to the controller name, and an ID equal to the controller and action name separated with a dash. For instance, the projects/new action's body would be <body class=projects id=projects-new>.

Controllers

For information about requests and responses, see {ApplicationController}.

Models

Models make extensive use of advanced PostgreSQL features for efficiency and convenience. Cached counters are updated using triggers and rules, foreign key constraints and hooks are enforced at the database level, and validations are backed up by corresponding CHECK triggers. This helps ensure referential and data integrity even in situations where Rails fails, or outside of the Rails stack. See the various migrations to learn more about the triggers, rules, and constraints being used.

Observers are used for more high-level triggers, such as creating {Event Events} at the appropriate times, or sending emails. See the classes in app/models/observers for more.

Models also use the HasMetadataColumn gem to reduce their width and incorporate schemaless data. Most models have a JSON-formatted metadata column to which new information can be added or removed without having to create new migrations.

Tasks

Various Rake tasks are available under lib/tasks. These include tasks for pruning and maintaining the database, development tasks, and configuring the workers.

Workers

Workers are found in the lib/workers directory. Along with OccurrencesWorker, which stores and categorizes Occurrences, there are other workers for managing Deploys and other minor tasks. These workers are run asynchronously using {Multithread}.

Mailers

Notification mails are sent by the {NotificationMailer}. It and any other mailers live in app/mailers.

NotificationMailer conditionally delivers emails. An email will only be delivered if all of the following conditions are met:

  • The Project has a mailing list email configured (for the critical-bugs and all-bugs mailing lists),
  • the Environment's sends_emails attribute is true, and
  • the User has enabled receipt of that category of emails (typically specified in the Membership).

Authentication and Authorization

Authentication is done using either password verification or LDAP; see {AuthenticationHelpers} and related controller mixins, as well as the model mixins under app/models/additions for more information.

There are four permissions levels that a User can have, specific to an individual Project:

Non-members do not have a {Membership} record with a Project. They can view Bugs and Occurrences, view the Project's API key, view the list of other Project members, watch Bugs, and comment on Bugs.

Members can do everything non-members can do, and can also assign Bugs, be assigned Bugs, and modify/delete Bugs.

Administrators can do everything members can do, and can also modify Project and Environment settings, regenerate the API key, promote and demote members to administrator status, and modify/delete others' Comments.

Owners (each Project has only one) can do everything administrators can do, and can also delete the Project and reassign ownership.

Recording and Categorizing Occurrences

Client-Specific Information

The client library identifiers used throughout the website determine how a Bug reported from that library is presented in the view. The {OccurrencesController::INDEX_FIELDS} constant maps a client library identifier to the relevant summary fields to display in the list view.

Each occurrence is transmitted with the name of the client library; the {Occurrence} records this to the client field. The {Bug}'s client field is set from the first Occurrence's; in general, one should expect that all Occurrences of a Bug share the same client value.

Regardless of the Occurrence's client value, all fields for which there is data are displayed in the Occurrence view.

If a client library is updated to add new information fields, all that is needed is to update the has_metadata hash in Occurrence with the new fields, and to update the occurrences#show view as necessary. (The INDEX_FIELDS hash can also be updated as appropriate.)

If a new client library is added, in addition to doing the above for any new fields unique to the new client, the INDEX_FIELDS hash will need to be expanded to include the new client.

Queue Consumer

For information about the background worker that converts incoming exception information into Occurrence and Bug records (including doing "best guess" commit blaming, determining which Occurrences share the same root Bug, etc.), see the documentation for the {OccurrencesWorker} module. See also Static Analysis below.

Deploys and Releases

Squash can handle both deployed projects (hosted projects for which typically only one version is live at a time) and released projects (distributed apps for which many versions may exist "in the wild").

If you are developing a released project, you must associate your {Deploy} objects with a unique version identifier (such as a build number). You must also send the correct build identifier with every occurrence report. See the client library and API controller documentation for more information.

Once this is done, Squash's behavior is changed slightly: Bugs that are fixed in an older release, but recur, are not reopened. Bugs that are fixed in an older release but then recur in newer releases are treated as completely separate Bugs.

This app exposes an API endpoint for notifying Squash of new releases/deploys of your Project. You should notify Squash whenever you deploy your Project (or release a new version) so that it can properly manage Bugs (automatically mark fixed Bugs as deployed, associate new Bugs with the new Deploy, etc.).

Most client libraries include an easy means to add this feature to your deploy or release process.

Static Analysis

Message Normalization

When an Occurrence is grouped into a Bug, its message is stripped of any non-relevant or situational information. (Note that since the message is not used as a dimension in grouping Occurrences, two Occurrences of the same Bug could have completely different messages. A Bug gets its message from its first Occurrence.) This is done by subclasses of {Blamer::Base}.

For most messages, this is done using simple regex subsitution. Squash can also normalize an exception's message using a list of known message templates. Such templates are stored in the data/message_templates.yml file. The file contains a hash mapping exception class names to an array of arrays. Each inner array contains two elements: the regexp to match the exception message on, and the replacement message should it match.

These templates are evaluated in the order they appear in the array. Scripts that regenerate the templates for MySQL and PostgreSQL error strings can be found under the script directory.

Version Control Systems

As of now, Squash is only compatible with projects that are version-controlled using Git. However, in the interest of remaining as VCS-agnostic as possible, commit identifiers are never called "SHA1s," but instead "IDs."

Unsymbolicated, Obfuscated, or Minified Stack Traces

Client libraries of compiled, obfuscated, or minified applications will need to convert their stack traces in order for them to be of use for static analysis. Because release builds are typically not distributed with embedded decompilation information, a mapping or table must be given to Squash, so that when Squash receives an unconverted stack trace, it can perform lookups and convert it to a more usable format.

Currently, the supported conversions are:

  • symbolication of iOS exceptions (see {Symbolication}),
  • deobfuscation of Java exceptions (see {ObfuscationMap}),
  • and source-mapping of JavaScript exceptions (see {SourceMap}).

Client libraries are responsible for delivering the raw stack trace data to Squash when an exception occurs, and for delivering lookup tables to Squash upon each new release. {Api::V1Controller} has endpoints for these purposes in various languages.

Unconverted stack traces are stored in a particular format; see {Occurrence} for more information. When a new exception with a stack trace in this format is received, Squash immediately attempts to convert it using an existing matching lookup table. If no such table is found, the stack trace is left unconverted. It can still be viewed on the front end. When, later, a new lookup table is added, Squash automatically finds and converts any matching stack traces.

Because every new Occurrence must be assigned a Bug (including unconverted Occurrences), it is possible that the "blamed" file and line fields of the Bug could themselves be unconverted. The {Bug} class has provisions to support this; see in particular bugs.special_file.

Specs

All models, controllers, and library files are unit-tested with RSpec specs under the spec directory. Run unit tests with the rspec spec command. Views and JavaScript files are not specced. No integration or acceptance tests are written. Almost all unit tests use factories rather than mocks, putting them somewhat closer to integration tests.

In general, the test environment is identical to the development/production environment, save for the usual Rails allowances, and the config/initializers/active_record_observer_hooks.rb file. This file adds after-commit hooks to observers (identical to those available to models). However, specs are transactionalized, meaning that these hooks wouldn't run until after the spec is completed, resulting in multiple spec failures.

To remedy this, the file introspects on the environment, and instead links the observer hooks to the after_save model hooks in the test environment. This differentiates the test and live environments, but allows specs to pass.

If you wish to bring your test environment closer to production, you can set the use_transactional_fixtures RSpec setting to false. The hooks file will automatically detect the change and use the correct after_commit hooks. Currently, all specs pass with and without transactionalized fixtures.

Third-Party Integrations

Squash supports integration with a handful of popular other developer tools.

PagerDuty

When Squash is integrated with PagerDuty, it will begin sending exceptions to PagerDuty once the Occurrence count for a given Bug exceeds the Project's critical threshold. Thereafter, every Occurrence is sent to PagerDuty as a trigger. The triggers are grouped into alerts by Bug, so users will only be paged once per new error.

In addition, marking a Bug fixed will also automatically resolve its associated PagerDuty alert (if any), and assigning a Bug or marking it irrelevant automatically acknowledges any associated PagerDuty alert.

In order to integrate Squash with PagerDuty, you must

  1. generate an API key that Squash can use for PagerDuty access (you must be a PagerDuty admin to do this),
  2. update the config/environments/common/pagerduty.yml file to enable PagerDuty integration and provide the API key,
  3. configure Generic API services for each escalation policy you wish to use, and
  4. set the PagerDuty-related options in your Project's configuration page.

JIRA

When Squash is integrated with JIRA, users have the option of associating a JIRA issue with any Bug. The Management tab will then display a link allowing the user to quickly view the associated issue.

In addition, the user can have Squash watch the JIRA issue for status updates. Once the JIRA issue is resolved (or is changed to someother specified status), the Bug can be automatically marked as fixed. By associating multiple Bugs with one JIRA issue in such a manner, a user can quickly fix a large number of Bugs by closing just one JIRA issue.

Finally, a "Create JIRA Issue" button is provided on the Management tab allowing users to easily create new JIRA issues for any Bug.

In order to integrate Squash with JIRA, you must

  1. configure the config/environments/common/jira.yml file with your JIRA authentication credentials and installation location, and
  2. add a cron job or other periodic task that runs rake jira:update.

JIRA integration works out-of-the-box if you use username/password authentication. OAuth authentication requires a few more steps. Because OAuth authentication requires user actions, you will need to obtain an access token and secret which the JIRA client can use without needing to prompt the user. You can do this by running the jira_oauth.rb script:

rails runner script/jira_oauth.rb

Follow the instructions to set up your JIRA integration.

web's People

Contributors

aidansteele avatar bjeanes avatar cbeer avatar codekitchen avatar codewarrior0 avatar davidmarkcarlson avatar douglasdollars avatar edruder avatar gamafranco avatar hesselink avatar localshred avatar lsegal avatar mchung avatar mereghost avatar mlitwiniuk avatar nicolai86 avatar openmailbox avatar pallan avatar riscfuture avatar skyisle avatar square-build-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web's Issues

Errors on creation of new (or incrementing old) bug

Hi all-

Seeing this issue quite often. Usually after the server has been running for a bit. Any thoughts on what might be going on?

Completed 200 OK in 13ms (ActiveRecord: 1.6ms)

-- ERROR IN OccurrencesWorker 70317008480860 --
undefined method `size' for nil:NilClass
/var/www/squash/lib/blamer.rb:257:in `file_and_line_for_bt_element'
/var/www/squash/lib/blamer.rb:222:in `blamed_revision'
/var/www/squash/lib/blamer.rb:195:in `bug_search_criteria'
/var/www/squash/lib/blamer.rb:119:in `find_or_create_bug!'
/var/www/squash/lib/workers/occurrences_worker.rb:119:in `perform'
/var/www/squash/app/controllers/api/v1_controller.rb:71:in `block in notify'
/var/www/squash/lib/multithread.rb:59:in `block (3 levels) in spinoff'
/var/www/squash/lib/multithread.rb:97:in `with_dogfood'
/var/www/squash/lib/multithread.rb:59:in `block (2 levels) in spinoff'
/usr/share/ruby-rvm/gems/ruby-1.9.3-p194@squash/bundler/gems/rails-a3aca81b21f7/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/var/www/squash/lib/multithread.rb:92:in `with_connection'
/var/www/squash/lib/multithread.rb:59:in `block in spinoff'
/var/www/squash/lib/multithread.rb:74:in `call'
/var/www/squash/lib/multithread.rb:74:in `block (4 levels) in start'
/var/www/squash/lib/multithread.rb:74:in `loop'
/var/www/squash/lib/multithread.rb:74:in `block (3 levels) in start'
/var/www/squash/lib/multithread.rb:74:in `catch'
/var/www/squash/lib/multithread.rb:74:in `block (2 levels) in start'```

View listing of deploys for a particular environment

It would be nice to view a list of deployments for a particular environment. Once we've had more than 1, we could even link to diffs, etc. We're already capturing the data, just not displaying it anywhere.

Any thoughts on whether this feature would be accepted? And if so, any suggestions on where to add it? Right now the only thing we display for a project/environment is a list of bugs - I'm not sure there's a precedent for an additional level of navigation?

Add Support Gems / Subprojects

Some times the bugs happen in gems you worked on.

It would be cool to be able to have the git blame run on the the repo of that gem and analyize it

Issues email even though marked as irrelevant

We have an issue marked as irrelevant ("Keep this bug, but don’t notify anyone about it"). However, when it passes the 'critical' threshold ("The number of times an exception has to occur before it is sent to the critical mailing list."), it is still emailed. It seems to me that it should be completely silenced.

No such middleware to insert before: Rack::SSL

Installing this in production mode on nginx and Passenger.

Followed the setup script all finished without an error. I am now loading the app in my browser and getting this error:

No such middleware to insert before: Rack::SSL

Any help would be great! Thanks!

uninitialized constant JIRA::Resource error

I have disabled the jira integration however when i upload a crash i get "uninitialized constant JIRA::Resource" error. Though the crash is getting uploaded. Please see the attached screenshots.
screen shot 2013-05-22 at 9 14 06 am

screen shot 2013-05-22 at 9 15 23 am

Squash is no longer accepting bugs. Likely related to #39.

I've just now realized that our squash instance is no longer recording bugs/occurrences as they are posted to the API. I have verified that the API keys are correct for the given projects we are using. I have tailed the squash log and watched the API posts received, but I am not getting any more bugs being recorded.

I am verifying this by querying for the most recent occurrence in the bugs table.

squash_production=# select latest_occurrence, environment_id from bugs order by latest_occurrence desc limit 1;
  latest_occurrence  | environment_id 
---------------------+----------------
 2013-02-01 15:57:15 |             17
(1 row)
squash_production=# select id, bug_id, occurred_at from occurrences order by occurred_at desc limit 1;
  id  | bug_id |     occurred_at     
------+--------+---------------------
 1122 |     58 | 2013-02-01 15:57:15
(1 row)

Please advise on the best course of action to take. This is likely related to #39.

first_occurrence and latest_occurrence field is always nil

I tried to upload a crash from a simple rails application. The crash is getting uploaded however first_occurrence and latest_occurrence field is always nil.

For example:
If i click the bug name "RuntimeError" (in the first screenshot), its throwing error .(See second screenshot

screen shot 2013-05-21 at 3 55 50 pm

screen shot 2013-05-21 at 4 01 04 pm
)

Create account after installation: NoMethodError undefined method `password`

Hi,

After installation, I get an error after a submit create account form :

NoMethodError (undefined method `password' for {"strategy"=>"password"}:Configoro::Hash:Configoro::Hash):
  configoro (1.1.0) lib/configoro/hash.rb:89:in `method_missing'
  app/models/additions/password_authentication.rb:82:in `encrypt'
  app/models/additions/password_authentication.rb:78:in `encrypt_password'
  app/controllers/users_controller.rb:80:in `create'

An idea to solve the problem?

Error resolving bug as fixed: "ERROR: no unpinned buffers available"

I'm still investigating the possible causes here but thought I'd create the issue to hopefully get more eyes on it.

Initially after standing up squash we've been able to resolve bugs as expected. As of yesterday (approximately one week after we've been using the squash exclusively) we are unable to mark bugs as fixed.

The log prints this exception whenever I attempt to close a bug now:

ActiveRecord::StatementInvalid (ActiveRecord::JDBCError: ERROR: no unpinned buffers available: UPDATE "bugs" SET "fixed" = 't', "metadata" = '{"message_template":"[REDACTED EXCEPTION MESSAGE]","special_file":false,"jira_issue":null,"notify_on_occurrence":[],"jira_status_id":null,"fixed_at":"2013-02-05T09:21:25-07:00"}' WHERE "bugs"."id" = 38):
  config/initializers/jdbc_fixes.rb:44:in `execute_with_retry'
  app/controllers/bugs_controller.rb:229:in `update'

We are running jruby version: jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on OpenJDK 64-Bit Server VM 1.7.0_09-b30 [linux-amd64]

We are running commit 9c1c57a39cf47cc543ce44aef2ba6d29ac297322, which is likely out of date. I can pull the latest if you would like and try again.

If you have any insight I'd be grateful.

App in production doesn't ever notify Squash Web...

I'm trying to get Squash implemented for our web application. Everything works great in development (development squash and development MyApp). It even works when I push squash up to production and cause an exception on my local app. However the moment I push that exact same app to the production server exceptions just don't seem to be notifying squash whatsoever.

I'm doing this from a rails project with very few adjustments to squash. I tail the log for squash and then hit an exception page on the site which deliberately raises the error undefined methodwill' for "This":String` -- I get an error page on the app as expected but squash gets nothing. When I do this from development in the app, I can look at the production squash log and see that it gets accessed, and looking at it from a browser shows the bug added into the development environment.

What would cause the notification to never hit squash from my production app?

My app has these gems:

gem 'squash_ruby', :require => 'squash/ruby'
gem 'squash_rails', :require => 'squash/rails'

The start of ApplicationController looks like this:

class ApplicationController < ActionController::Base
  include Squash::Ruby::ControllerMethods
  enable_squash_client

And I've added this to the bottom of application.rb:

Squash::Ruby.configure :api_key => 'key-from-squash-app',
               :api_host => 'url-for-squash-app'

Not sure what I'm doing wrong from the production side of things :(

Can't manage bugs if mailer connection refused

I set the app to email me

I went to assign myself a bug, error.

The log showed

Completed 500 Internal Server Error in 257ms

Errno::ECONNREFUSED (Connection refused - Connection refused):
 app/mailers/notification_mailer.rb:40:in `deliver'

So, I configured the mailer in config/environments/production.rb and now I can update and close bugs. Seems like a failure that shouldn't affect saving data.

config.action_mailer.default_url_options = { :host => 'example.com' }
# ActionMailer Config
# Setup for production - deliveries, no errors raised
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"

config.action_mailer.smtp_settings = {
  :address => 'smtp.example.com',
  :port => 587,
  :domain => "example.com"
}

Also, the
setup script didn't prompt us to setup and configure the smtp server

Web app should give better instructions for initializing a rails app

We probably don't want development errors being transmitted, as

  1. that's noisy
  2. those commits aren't likely available to squash (and the Blamer will fail)

on the overlay popped up by Learn how to add Squash to your project

I'd specifically recommend a rails app have config/initializers/squash.rb containing

if Rails.env.production?
  Squash::Ruby.configure :api_host => 'https://example.com',
                         :api_key => 'abc123'

  class ApplicationController < ActionController::Base
    include Squash::Ruby::ControllerMethods
    enable_squash_client
  end
end

Occurrences don't handle fragments correctly

URI::HTTP.build takes fragments without a hash #. I haven't investigated this thoroughly, but at least with IE 9.0, we store fragments with a leading #, causing Occurrence#url to throw an exception:

URI::InvalidComponentError: bad component(expected fragment component): #/dashboard/settings
    from /usr/lib/ruby/1.9.1/uri/generic.rb:1000:in `check_fragment'
    from /usr/lib/ruby/1.9.1/uri/generic.rb:1041:in `fragment='
    from /usr/lib/ruby/1.9.1/uri/generic.rb:200:in `initialize'
    from /usr/lib/ruby/1.9.1/uri/http.rb:84:in `initialize'
    from /usr/lib/ruby/1.9.1/uri/generic.rb:140:in `new'
    from /usr/lib/ruby/1.9.1/uri/generic.rb:140:in `build'
    from /usr/lib/ruby/1.9.1/uri/http.rb:62:in `build'
    from /home/squash/web/app/models/occurrence.rb:510:in `url'

I fixed it locally with this patch:

diff --git a/app/models/occurrence.rb b/app/models/occurrence.rb
index 20d075e..1cfb280 100644
--- a/app/models/occurrence.rb
+++ b/app/models/occurrence.rb
@@ -507,7 +507,7 @@ class Occurrence < ActiveRecord::Base
     @url ||= begin
       return nil unless web?
       return nil unless URI.scheme_list.include?(schema.upcase)
-      URI.scheme_list[schema.upcase].build(host: host, port: port, path: path, query: query, fragment: fragment)
+      URI.scheme_list[schema.upcase].build(host: host, port: port, path: path, query: query, fragment: fragment.sub(/^#/, ""))
     end
   end

But I'm not sure what the correct solution is for Squash -- perhaps we want to strip the leading # when storing occurrences.

Problems on the payload processing

One of my monitored apps sent an ArgumentError that exploded on the Rack Middleware and somehow, Squash didn't process the issue correctly.

Now we are presented with an error without an error count or latest occurrences.

squash

Any ideas on what may cause that?

Postgres 9.1 dependencies

The readme states that Postgres 9.0 or later is required. Actually, Postgres 9.1 or later is required as one of the rake setup tasks creates an unlogged table. Unlogged tables are only available in 9.1 and later.

rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR:  syntax error at or near "UNLOGGED"
LINE 1:       CREATE UNLOGGED TABLE blames (
                     ^
:       CREATE UNLOGGED TABLE blames (
        id SERIAL PRIMARY KEY,
        repository_hash CHARACTER(40) NOT NULL,
        revision CHARACTER(40) NOT NULL,
        file CHARACTER VARYING(255) NOT NULL CHECK (CHAR_LENGTH(file) > 0),
        line INTEGER NOT NULL CHECK (line > 0),
        blamed_revision CHARACTER VARYING(40) NOT NULL,
        updated_at TIMESTAMP WITHOUT TIME ZONE
      )

Redirects to https

Hello,
I have installed Squash as directed. Ran the setup script, when it asked for HTTPS i said no "n".

The setup finishes but now when trying to access the app it redirects from http://... to https://

Not sure what the deal is but would love some help if anyone else is seeing this...

squash/rails/capistratno file error

/Users/yangchenyun/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/squash_rails-1.0.0/lib/squash/rails/capistrano.rb:17:in `<top (required)>': undefined method `desc' for main:Object (NoMethodError)

I check the gem source, it seems the capistrano tasks aren't wrapped correctly, it should be wrapped in such as:

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
# tasks
end

Better Jira Integration

I feel like there should be the ability to assign a Project in Squash a project key in Jira so that it automatically creates a new Jira incident for a new bug. It seems this functionality is almost there, but you have to click a lot of buttons.

I might consider forking this to add things like this, along with a few other tweaks.

Issue accessing crash tracker details within Squash

Currently, we are experiencing an issue where "rspec spec" is returning 5 errors, and we are unable to access the bug details page in what seems to be a related issue.

The main issue is that we get a "undefined method `[]=' for nil:NilClass" when we have received a bug in squash, and are attempting to click the bug in order to view the details. We've shown that we're getting to line 310 in app/views/layouts/application.html.rb where the raw ERB file (app/views/bugs/show.js.erb) is being converted into javascript, and then it dies within that function.

The current machine setup is OSX 10.8.2 using RVM with ruby 1.9.2-p320 and 1.9.3-p362. The scenarios tested have been with personal repos and using the sample shown in the video on the squash.io page (installing an error in the squash server and then sending the error to a full squash server). I have sent crashes from the ruby, ruby on rails, and ios versions of the client and they all encounter the same issue when clicking the bug for additional details. All the bugs successfully appear in the database and are displayed on the local Squash server GUI.

It seems like there may be a configuration issue that may need to be checked for, given that rspec does not complete 100%. I would appreciate any possible advice in system setup or other possible scenarios to investigate. This was tested on master as of 1-23-13, and tested against SHA eac1de2. I could not test against the initial commit (73e9571) due to therubyracer issue that was fixed in eac1de2.

The actual error reported on access:

ActionView::Template::Error (undefined method `[]=' for nil:NilClass):
    1: 
    2: 
    3: # Copyright 2012 Square Inc.
    4: #
  app/views/layouts/application.html.rb:310:in `inline_javascript'
  app/views/layouts/application.html.rb:148:in `block in body_portion'
  app/views/layouts/application.html.rb:135:in `body_portion'
  app/views/layouts/application.html.rb:27:in `block in content'
  app/views/layouts/application.html.rb:25:in `content'
  app/views/bugs/show.html.rb:1:in `_app_views_bugs_show_html_rb__1634622433784757136_70354261740560'
  app/controllers/bugs_controller.rb:184:in `show'

The errors reported by rspec:

  1) BugsController#show [authenticated] should set duplicate_of_number
     Failure/Error: get :show, polymorphic_params(@bug, false)
     ActionView::Template::Error:
       undefined method `[]=' for nil:NilClass
     # (erb):46:in `inline_javascript'
     # ./app/views/layouts/application.html.rb:310:in `inline_javascript'
     # ./app/views/layouts/application.html.rb:148:in `block in body_portion'
     # ./app/views/layouts/application.html.rb:135:in `body_portion'
     # ./app/views/layouts/application.html.rb:27:in `block in content'
     # ./app/views/layouts/application.html.rb:25:in `content'
     # ./app/views/bugs/show.html.rb:1:in `_app_views_bugs_show_html_rb__3920424542436900343_70292377150420'
     # ./app/controllers/bugs_controller.rb:184:in `show'
     # ./spec/controllers/bugs_controller_spec.rb:175:in `block (4 levels) in <top (required)>'

  2) DeployFixMarker should mark the appropriate bugs as fix_deployed
     Failure/Error: DeployFixMarker.perform deploy.id
     NoMethodError:
       undefined method `[]=' for nil:NilClass
     # ./lib/workers/deploy_fix_marker.rb:49:in `any?'
     # ./lib/workers/deploy_fix_marker.rb:49:in `perform'
     # ./lib/workers/deploy_fix_marker.rb:31:in `perform'
     # ./spec/lib/deploy_fix_marker_spec.rb:34:in `block (2 levels) in <top (required)>'

  3) DeployFixMarker should create events for the fixed bugs
     Failure/Error: DeployFixMarker.perform deploy.id
     NoMethodError:
       undefined method `[]=' for nil:NilClass
     # ./lib/workers/deploy_fix_marker.rb:49:in `any?'
     # ./lib/workers/deploy_fix_marker.rb:49:in `perform'
     # ./lib/workers/deploy_fix_marker.rb:31:in `perform'
     # ./spec/lib/deploy_fix_marker_spec.rb:50:in `block (2 levels) in <top (required)>'

  4) OccurrencesWorker#perform [distributed projects] should create a new bug if the occurrence is associated with a different deploy
     Failure/Error: DeployFixMarker.perform(d3.id)
     NoMethodError:
       undefined method `[]=' for nil:NilClass
     # ./lib/workers/deploy_fix_marker.rb:49:in `any?'
     # ./lib/workers/deploy_fix_marker.rb:49:in `perform'
     # ./lib/workers/deploy_fix_marker.rb:31:in `perform'
     # ./spec/lib/occurrences_worker_spec.rb:237:in `block (4 levels) in <top (required)>'

  5) OccurrencesWorker#perform [hosted projects] should reopen a bug only at the proper times
     Failure/Error: DeployFixMarker.perform(d.id)
     NoMethodError:
       undefined method `[]=' for nil:NilClass
     # ./lib/workers/deploy_fix_marker.rb:49:in `any?'
     # ./lib/workers/deploy_fix_marker.rb:49:in `perform'
     # ./lib/workers/deploy_fix_marker.rb:31:in `perform'
     # ./spec/lib/occurrences_worker_spec.rb:298:in `block (4 levels) in <top (required)>'

Ability to create issue on Github from Squash bug

Hey there-

We're moving from Airbrake to Squash and one thing we really miss is the ability to create Github issues directly from the web interface (or email). Happy to dig in and submit a PR if this is something that seems interesting to y'all. Would just need some details on where you'd like the link to live in UI.
Screen Shot 2013-01-25 at 11 03 27 AM

Thanks!

Invite people when registration is disabled

It would be nice to be able to invite people to Squash even when the global registration is disabled (primarily usefull for password login I think)
So one could disable registration but still add new team members.

Opinions on that?

Squash doesn't process exception sent by clients

I've a Rails client setup and it could communicates with Squash web properly.

When I mannually notify_squash, the log in the web application records the data correctly. However, squash doesn't update about the bug. In the log, it records

[Multithread] Dropping operation : at capacity

Is there something I am missing? Or how could I zero in on the problem?

Attempting to create a new deploy fails with NoMethodError

Started POST "/api/1.0/deploy" for xxx at 2013-03-20 15:37:01 +0000
Processing by Api::V1Controller#deploy as */*
  Parameters: {"project"=>{"api_key"=>"xxxx-8687-4ddf-9dd5-74dafe2223a7"}, "environment"=>{"name"=>"staging"}, "deploy"=>{"deployed_at"=>"2013-03-20T15:37:01+00:00", "revision"=>"31353d10fe01625c36d3e3d65bad9845db1b506b", "hostname"=>"staging"}}
Completed 500 Internal Server Error in 5641ms

NoMethodError (undefined method `new' for nil:NilClass):
  lib/repo_proxy.rb:47:in `method_missing'
  lib/known_revision_validator.rb:61:in `validate_each'
  app/controllers/api/v1_controller.rb:87:in `deploy'
  config/initializers/concurrency.rb:16:in `call'
  config/initializers/concurrency.rb:16:in `block (2 levels) in <top (required)>'

Overriding @bug.environment for correct domain reporting

We are running squash on an Apache virtual host so that while the box its running on is actually called box1, it is actually mapped to vbox1.

When emails are sent they are reported as coming from box1.domain.com/... (and linked in kind), when they should be reported as vbox1.domain.com/....

In short, does their exist some way to override the environment on the app to point to vbox1 domain?

build numbers

How do I associate a new build number with a Java project?

The java deobfuscator and java client both make use of a build number. If I just put a number like 1, requests to notify fail because the build number and the deobfuscator fails because of the build number. Is there something I need to be doing to associate a build number before trying to upload stuff?

log when calling deobfuscator:

Started POST "/api/1.0/deobfuscation.json" for ... at 2013-01-24 17:52:04 -0600
Processing by Api::V1Controller#deobfuscation as JSON
Parameters: {"api_key"=>"...", "environment"=>"dev", "build"=>"1", "namespace"=>"eJzT1dVVUCwqTarUz0/KSk0usQouLE0szrCy8kosS7Sy8kvMTS0uSExO5QIS\n2YnpqfFF+fklxVZoelJLuBQUMkD6FKpruQDLghzW\n"}
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."api_key" = '...' LIMIT 1
app/controllers/api/v1_controller.rb:128:in deobfuscation' Environment Load (0.4ms) SELECT "environments".* FROM "environments" WHERE "environments"."project_id" = 2 AND (LOWER(name) = 'dev') LIMIT 1 app/controllers/api/v1_controller.rb:128:indeobfuscation'
Deploy Load (0.4ms) SELECT "deploys".* FROM "deploys" WHERE "deploys"."environment_id" = 2 AND "deploys"."build" = '1' LIMIT 1
app/controllers/api/v1_controller.rb:128:in `deobfuscation'
Completed 404 Not Found in 14ms (ActiveRecord: 1.3ms)

API call from javascript plugin throws error: private method `select' called for nil:NilClass

Included the javascript plugin in my application, enabled CORS in squash and triggered an Error. The following was the result in the log:

Started OPTIONS "/api/1.0/notify" for 192.168.56.73 at 2013-03-20 13:51:52 +0100
Started POST "/api/1.0/notify" for 192.168.56.73 at 2013-03-20 13:51:52 +0100
Processing by Api::V1Controller#notify as */*
  Parameters: {"api_key"=>"Xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "environment"=>"production", "client"=>"javascript", "revision"=>"84bf092b2470debef3d494b96ae4b057d9d49a77", "class_name"=>"Error", "message"=>"Test JavaScript error!", "backtraces"=>[{"name"=>"Active Thread", "faulted"=>true, "backtrace"=>nil}], "capture_method"=>"callers", "occurred_at"=>"2013-03-20T12:52:21Z", "schema"=>"https", "host"=>"www.test.nl", "path"=>"/", "query"=>"", "fragment"=>"#/login", "user_agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22", "screen_width"=>1920, "screen_height"=>1200, "window_width"=>1276, "window_height"=>721, "color_depth"=>24}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
-- ERROR IN OccurrencesWorker 44860100 --
private method `select' called for nil:NilClass
/home/beheer/squash/lib/blamer.rb:222:in `blamed_revision'
/home/beheer/squash/lib/blamer.rb:195:in `bug_search_criteria'
/home/beheer/squash/lib/blamer.rb:119:in `find_or_create_bug!'
/home/beheer/squash/lib/workers/occurrences_worker.rb:86:in `perform'
/home/beheer/squash/lib/workers/occurrences_worker.rb:43:in `perform'
/home/beheer/squash/lib/background_runner/multithread.rb:32:in `block in run'
/home/beheer/squash/lib/multithread.rb:62:in `block (3 levels) in spinoff'
/home/beheer/squash/lib/multithread.rb:100:in `with_dogfood'
/home/beheer/squash/lib/multithread.rb:62:in `block (2 levels) in spinoff'
/home/beheer/squash/vendor/bundle/ruby/1.9.1/bundler/gems/rails-f1efecfc3f00/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/home/beheer/squash/lib/multithread.rb:95:in `with_connection'
/home/beheer/squash/lib/multithread.rb:62:in `block in spinoff'
/home/beheer/squash/lib/multithread.rb:77:in `call'
/home/beheer/squash/lib/multithread.rb:77:in `block (4 levels) in start'
/home/beheer/squash/lib/multithread.rb:77:in `loop'
/home/beheer/squash/lib/multithread.rb:77:in `block (3 levels) in start'
/home/beheer/squash/lib/multithread.rb:77:in `catch'
/home/beheer/squash/lib/multithread.rb:77:in `block (2 levels) in start'
{"client"=>"javascript", "revision"=>"84bf092b2470debef3d494b96ae4b057d9d49a77", "message"=>"Test JavaScript error!", "backtraces"=>[{"name"=>"Active Thread", "faulted"=>true, "backtrace"=>nil}], "capture_method"=>"callers", "occurred_at"=>"2013-03-20T12:52:21Z", "schema"=>"https", "host"=>"www.test.nl", "path"=>"/", "query"=>"", "fragment"=>"#/login", "user_agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22", "screen_width"=>1920, "screen_height"=>1200, "window_width"=>1276, "window_height"=>721, "color_depth"=>24}
-- END ERROR 44860100 --

Preset secure_token opens up users to session fixation attacks

https://github.com/SquareSquash/web/blob/master/config/initializers/secret_token.rb#L21

One solution would be to remove secret_token.rb from the repo (but not gitignore it) and automate its creation in setup.rb so that every user gets a unique secret token.

There's active discussion about changing the default mechanism for setting up secret tokens in rails core, but no outcome yet, so you're probably best brewing this on your own for now.

Python Client Library?

I'm curious if anyone is already working on a Squash client library for Python applications, either web apps or desktop apps. I'm developing a desktop app in Python and am interested in using Squash to track exceptions, so I've put together a bare bones reporting module that sends a single "occurrence" to the Squash notify API.

If I won't be duplicating someone else's effort, I'll try to flesh out that mini-reporter into a full client library similar to the Cocoa/IOS libraries.

Usernames with dots break the URLs

I've gotten this exception thrown when trying to use it.

ActionController::RoutingError (No route matches [PUT] "/projects/project-name/memberships/member-name.json"): app/middleware/ping.rb:29:in `call'

EDIT: Hmm... after some investigation it seems to happen only on usernames containing a dot (ex: marcello.rocha)

Specs don't run on a clean checkout

Based on the output from this build (a test run for future pull request #59), it seems that it expects the config files to be set up with certain values which only get written out by setup.rb.

Are there any downsides you foresee to giving all configs sane default values, prior to a setup.rb run, @RISCfuture? Alternatively (and possibly more desirably), the tests could setup the configs as they expect them (i.e. if a test relies on authentication being set to "password", it should just set it up front for that test).

setup.rb syntax error

ruby ./setup.rb 
./setup.rb:121: syntax error, unexpected tSTRING_BEG, expecting tAMPER
  say "Running".cyan, *command.map { |s| s.cyan.bold }, "...".cyan
                                                         ^
./setup.rb:137: syntax error, unexpected tSTRING_BEG, expecting tAMPER
...and.map { |s| s.cyan.bold }, "... (failure OK)".cyan
                              ^
./setup.rb:258: syntax error, unexpected kDO_BLOCK, expecting kEND
  File.open('config/environments/common/mailer.yml', 'w') do |f|
                                                            ^
./setup.rb:265: syntax error, unexpected kDO_BLOCK, expecting $end
  File.open('config/environments/production/mailer.yml', 'w') do |f|

Unable to bundle rails from git?

I am getting this error after i run bundle install and loading the page in a browser:

git://github.com/rails/rails.git (at 3-2-stable) is not checked out. Please run bundle install (Bundler::GitError)

Note: I have ran bundle install

Add mercurial support

What's the possibility of adding mercurial support to this? Or where would I find the git support to see how possible it would be to implement the same for hg.

Gemfile.lock is not up to date

Please run bundler when you update the Gemfile or add Gemfile.lock to gitignore (I wouldn't recommend that though), an out of date Gemfile.lock doesn't help anyone :)

Fork of composite-primary-keys doesn't work with current ActiveRecord

I'm trying to get Squash to run on Heroku. I have several fixes going, but here's one that I'm not sure what to do about. I get "production database not configured" trying to start the server. That's because the fork-of-a-fork of composite-primary-keys contains a monkey patch of ActiveRecord::Base.establish_connection that is out of date with current ActiveRecord code. The original drnic repo has working code, but I don't know whether it's safe to change to that.

The simplest solution would be for you to update your fork of CPK. Is that possible?

The code in question is here:
https://github.com/drnic/composite_primary_keys/blob/master/lib/composite_primary_keys/connection_adapters/abstract/connection_specification_changes.rb

Unable to log JavaScript errors: undefined method `start_with?' for nil:NilClass

Every JavaScript error that the notifier sends to the web app ends up with an error like this:

Started POST "/api/1.0/notify" for [IP] at 2013-03-05 14:27:48 +0000
Processing by Api::V1Controller#notify as */*
  Parameters: {"api_key"=>"[KEY]", "environment"=>"production", "client"=>"javascript", "revision"=>"[REVISION]", "class_name"=>"Error", "message"=>"Script error.", "backtraces"=>[{"name"=>"Active Thread", "faulted"=>true, "backtrace"=>[{"url"=>"", "line"=>0, "symbol"=>"?", "context"=>nil}]}], "capture_method"=>"onerror", "occurred_at"=>"2013-03-05T14:27:48Z", "schema"=>"http", "host"=>"[HOST]", "path"=>"/", "query"=>"?generate_squash_error=true", "user_agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22", "screen_width"=>2560, "screen_height"=>1440, "window_width"=>2560, "window_height"=>1346, "color_depth"=>24}
Completed 200 OK in 17ms (ActiveRecord: 3.2ms)
-- ERROR IN OccurrencesWorker 69109060 --
undefined method `start_with?' for nil:NilClass
/srv/app/squash/releases/current/app/models/project.rb:243:in `path_type'
/srv/app/squash/releases/current/lib/blamer.rb:223:in `block in blamed_revision'
/srv/app/squash/releases/current/lib/blamer.rb:223:in `select!'
/srv/app/squash/releases/current/lib/blamer.rb:223:in `blamed_revision'
/srv/app/squash/releases/current/lib/blamer.rb:195:in `bug_search_criteria'
/srv/app/squash/releases/current/lib/blamer.rb:119:in `find_or_create_bug!'
/srv/app/squash/releases/current/lib/workers/occurrences_worker.rb:119:in `perform'
/srv/app/squash/releases/current/app/controllers/api/v1_controller.rb:71:in `block in notify'
/srv/app/squash/releases/current/lib/multithread.rb:59:in `block (3 levels) in spinoff'
/srv/app/squash/releases/current/lib/multithread.rb:97:in `with_dogfood'
/srv/app/squash/releases/current/lib/multithread.rb:59:in `block (2 levels) in spinoff'
/srv/app/squash/shared/bundle/ruby/1.9.1/bundler/gems/rails-f1efecfc3f00/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/srv/app/squash/releases/current/lib/multithread.rb:92:in `with_connection'
/srv/app/squash/releases/current/lib/multithread.rb:59:in `block in spinoff'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `call'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `block (4 levels) in start'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `loop'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `block (3 levels) in start'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `catch'
/srv/app/squash/releases/current/lib/multithread.rb:74:in `block (2 levels) in start'
{"client"=>"javascript", "revision"=>"[REVISION]", "message"=>"Script error.", "backtraces"=>[{"name"=>"Active Thread", "faulted"=>true, "backtrace"=>[{"url"=>"", "line"=>0, "symbol"=>"?", "context"=>nil}]}], "capture_method"=>"onerror", "occurred_at"=>"2013-03-05T14:27:48Z", "schema"=>"http", "host"=>"[HOST]", "path"=>"/", "query"=>"?generate_squash_error=true", "user_agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22", "screen_width"=>2560, "screen_height"=>1440, "window_width"=>2560, "window_height"=>1346, "color_depth"=>24}
-- END ERROR 69109060 --

I've seen this previously when the code was uncommitted, but this code is definitely committed to the canonical repo.

The code that I'm using to generate a test error is at the end of the app's application.js:

if (window.location.search.indexOf("generate_squash_error=true") != -1) {
  error = new Error("Test JavaScript error!");
  throw(error);
};

However, even errors that aren't this test one end up causing this error in the web app. What am I doing wrong?

LDAP search_key gotcha

At $work we tend to use email addresses for AD/LDAP user authentication, so naturally when configuring LDAP authentication I used userPrincipalName instead of sAMAccountName as the search_key.

This ends up failing the authentication as Squash strips off the email suffix from the provided username. The setup.rb could potentially warn about this and swap userPrincipalName with sAMAccountName.

Update PostgreSQL version requirement

Hi,

In the README it says that PostgreSQL 8.4 or newer is required, but the setup.rb checks for version >= 9.
One of those two needs to be updated :p

Rack::Cache is not included in the Gemfile

Rack::Cache is added by the setup.rb script when I turn off SSL.
When I deployed to server, it compains miss of rack-cache.

add gem 'rack-cache' to Gemfile solves this issue

Some common operations take too many clicks, and other UI nags.

After using your excellent piece of software for a few days, I've found a few things I wish were easier to get to.

When I look at a bug, the first two things I want to look at are a backtrace from a recent occurrence and a quick analysis of some metadata fields from all occurrences. To view the backtrace now, I have to click on the bug, then click "Occurrences", then click on an occurrence, then click on several lines of the displayed backtrace to expand them and see which lines of code were involved. (I'm used to Python's default backtrace format, which shows the source line for each backtrace line if it is available.)

For the user data, I want to see counts of the different values of several data fields. My app reports the OS name and version, the OpenGL version, vendor, and renderer, the encoding returned by sys.getfilesystemencoding, and whether or not the user's home folder path contains characters that can't be encoded with ASCII. It's useful to know for example that an issue only affects Windows XP, or OpenGL <1.3, or Intel HD Graphics rendering, et cetera.

I'm probably not using the metadata correctly, since I'm not filling in any of the "standard" metadata fields specified in occurrence.rb. I will fill in some of the ones under 'Client Applications' and see if it makes a difference in my next dev build. (As a side note, I think the OpenGL version, vendor, and renderer fields should be made into standard metadata fields.)

The last thing that bugs me is marking a bug 'fixed'. I have to click on the bug, click on Management, scroll down some, tick the checkbox, then scroll allll the way to the bottom for the "Update Bug" button.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.