kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

Mismatch between cws metadata column tag and downloaded metadata #139

Open NyakudyaA opened 7 years ago

NyakudyaA commented 7 years ago

Problem

From cws if a layer is added to geonode . It is downloaded as a shapefile before the analysis is run. This causes column names to be truncated. flood_prone becomes flood_pron.

For metadata that was using a column flood_prone it now fails to find it and does not run and causes an errror:

[2016-12-22 11:39:18,854: INFO/MainProcess] Received task: headless.tasks.inasafe_wrapper.run_analysis[a7e62bca-0d5c-4e10-a82e-48f301304c53]  
[2016-12-22 11:39:19,233: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/4
[2016-12-22 11:39:19,346: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/55
[2016-12-22 11:39:19,745: DEBUG/PoolWorker-1] CommandLineArguments
[2016-12-22 11:39:19,770: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:19,776: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:19,777: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'startswith'
[2016-12-22 11:39:19,777: WARNING/PoolWorker-1] Attribute not found.
[2016-12-22 11:39:19,912: WARNING/PoolWorker-1] No extents
[2016-12-22 11:39:19,924: DEBUG/PoolWorker-1] createdEntire area
2016-12-22 11:39:20,129 - InaSAFE - ERROR - An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:20,228: ERROR/PoolWorker-1] Unable to reach Sentry log server: HTTP Error 502: Bad Gateway (url: http://sentry.kartoza.com/api/store/, body: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>

<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Thu, 22-Dec-16 11:39:50 GMT; path=/">

<title>sentry.kartoza.com | 502: Bad gateway</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
<div id="cf-wrapper">

    <div id="cf-error-details" class="cf-error-details-wrapper">
        <div class="cf-wrapper cf-error-overview">
            <h1>
              <span class="cf-error-type" data-translate="error">Error</span>
              <span class="cf-error-code">502</span>
              <small class="heading-ray-id">Ray ID: 31534aeb4534266c &bull; 2016-12-22 11:39:20 UTC</small>
            </h1>
            <h2 class="cf-subheadline" data-translate="error_desc">Bad gateway</h2>
        </div><!-- /.error-overview -->

        <div class="cf-section cf-highlight cf-status-display">
            <div class="cf-wrapper">
                <div class="cf-columns cols-3">

<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-browser"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="browser_desc">You</span>
  <h3 class="cf-status-name" data-translate="browser_label">Browser</h3>
  <span class="cf-status-label" data-translate="browser_status_label">Working</span>
</div>

<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-cloud"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="cloud_desc">Frankfurt</span>
  <h3 class="cf-status-name" data-translate="cloud_label">CloudFlare</h3>
  <span class="cf-status-label" data-translate="cloud_status_label">Working</span>
</div>

<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-server"></i>
    <i class="cf-icon-status cf-icon-error"></i>
  </div>
  <span class="cf-status-desc" data-translate="server_desc">sentry.kartoza.com</span>
  <h3 class="cf-status-name" data-translate="server_label">Host</h3>
  <span class="cf-status-label" data-translate="server_status_label">Error</span>
</div>

                </div>
            </div>
        </div><!-- /.status-display -->

        <div class="cf-section cf-wrapper">
            <div class="cf-columns two">
                <div class="cf-column">
                    <h2 data-translate="what_happened">What happened?</h2>
                    <p>The web server reported a bad gateway error.</p>
                </div>

                <div class="cf-column">
                    <h2 data-translate="what_can_i_do">What can I do?</h2>
                    <p data-translate="try_again_in_a_few">Please try again in a few minutes.</p>
                </div>
            </div>
        </div><!-- /.section -->

        <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong>31534aeb4534266c</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 88.99.33.48</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
)
Traceback (most recent call last):
  File "/home/src/inasafe/safe_extras/raven/base.py", line 432, in send_remote
    self._send_remote(url=url, data=data, headers=headers)
  File "/home/src/inasafe/safe_extras/raven/base.py", line 406, in _send_remote
    return transport.send(data, headers)
  File "/home/src/inasafe/safe_extras/raven/transport/base.py", line 144, in send
    response = urllib2.urlopen(req, data, self.timeout).read()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway
[2016-12-22 11:39:20,242: ERROR/PoolWorker-1] Failed to submit message: u'An exception occurred when running the impact analysis.'
[2016-12-22 11:39:20,129: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:20,249: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:20,258: ERROR/PoolWorker-1] Task headless.tasks.inasafe_wrapper.run_analysis[a7e62bca-0d5c-4e10-a82e-48f301304c53] raised unexpected: RuntimeError("'NoneType' object has no attribute 'is_raster'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/src/inasafe/headless/tasks/inasafe_wrapper.py", line 84, in run_analysis
    impact_layer = run_impact_function(arguments)
  File "/home/src/inasafe/bin/inasafe.py", line 325, in run_impact_function
    write_results(command_line_arguments, impact_layer)
  File "/home/src/inasafe/bin/inasafe.py", line 412, in write_results
    raise RuntimeError(exception.message)
RuntimeError: 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:25,287: INFO/MainProcess] Received task: headless.tasks.inasafe_wrapper.run_analysis[048838bb-5eae-4258-8066-6009015565cb]  
[2016-12-22 11:39:27,237: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/4
[2016-12-22 11:39:27,341: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/55
[2016-12-22 11:39:27,643: DEBUG/PoolWorker-1] CommandLineArguments
[2016-12-22 11:39:27,647: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:27,653: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:27,653: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'startswith'
[2016-12-22 11:39:27,654: WARNING/PoolWorker-1] Attribute not found.
[2016-12-22 11:39:27,817: WARNING/PoolWorker-1] No extents
[2016-12-22 11:39:27,826: DEBUG/PoolWorker-1] createdEntire area
2016-12-22 11:39:27,995 - InaSAFE - ERROR - An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:28,037: ERROR/PoolWorker-1] Unable to reach Sentry log server: HTTP Error 502: Bad Gateway (url: http://sentry.kartoza.com/api/store/, body: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>

<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Thu, 22-Dec-16 11:39:58 GMT; path=/">

<title>sentry.kartoza.com | 502: Bad gateway</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
<div id="cf-wrapper">

    <div id="cf-error-details" class="cf-error-details-wrapper">
        <div class="cf-wrapper cf-error-overview">
            <h1>
              <span class="cf-error-type" data-translate="error">Error</span>
              <span class="cf-error-code">502</span>
              <small class="heading-ray-id">Ray ID: 31534b1c15eb63cd &bull; 2016-12-22 11:39:28 UTC</small>
            </h1>
            <h2 class="cf-subheadline" data-translate="error_desc">Bad gateway</h2>
        </div><!-- /.error-overview -->

        <div class="cf-section cf-highlight cf-status-display">
            <div class="cf-wrapper">
                <div class="cf-columns cols-3">

<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-browser"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="browser_desc">You</span>
  <h3 class="cf-status-name" data-translate="browser_label">Browser</h3>
  <span class="cf-status-label" data-translate="browser_status_label">Working</span>
</div>

<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-cloud"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="cloud_desc">Frankfurt</span>
  <h3 class="cf-status-name" data-translate="cloud_label">CloudFlare</h3>
  <span class="cf-status-label" data-translate="cloud_status_label">Working</span>
</div>

<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-server"></i>
    <i class="cf-icon-status cf-icon-error"></i>
  </div>
  <span class="cf-status-desc" data-translate="server_desc">sentry.kartoza.com</span>
  <h3 class="cf-status-name" data-translate="server_label">Host</h3>
  <span class="cf-status-label" data-translate="server_status_label">Error</span>
</div>

                </div>
            </div>
        </div><!-- /.status-display -->

        <div class="cf-section cf-wrapper">
            <div class="cf-columns two">
                <div class="cf-column">
                    <h2 data-translate="what_happened">What happened?</h2>
                    <p>The web server reported a bad gateway error.</p>
                </div>

                <div class="cf-column">
                    <h2 data-translate="what_can_i_do">What can I do?</h2>
                    <p data-translate="try_again_in_a_few">Please try again in a few minutes.</p>
                </div>
            </div>
        </div><!-- /.section -->

        <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong>31534b1c15eb63cd</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 88.99.33.48</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
)
Traceback (most recent call last):
  File "/home/src/inasafe/safe_extras/raven/base.py", line 432, in send_remote
    self._send_remote(url=url, data=data, headers=headers)
  File "/home/src/inasafe/safe_extras/raven/base.py", line 406, in _send_remote
    return transport.send(data, headers)
  File "/home/src/inasafe/safe_extras/raven/transport/base.py", line 144, in send
    response = urllib2.urlopen(req, data, self.timeout).read()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway
[2016-12-22 11:39:28,042: ERROR/PoolWorker-1] Failed to submit message: u'An exception occurred when running the impact analysis.'
[2016-12-22 11:39:27,995: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:28,044: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:28,052: ERROR/PoolWorker-1] Task headless.tasks.inasafe_wrapper.run_analysis[048838bb-5eae-4258-8066-6009015565cb] raised unexpected: RuntimeError("'NoneType' object has no attribute 'is_raster'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/src/inasafe/headless/tasks/inasafe_wrapper.py", line 84, in run_analysis
    impact_layer = run_impact_function(arguments)
  File "/home/src/inasafe/bin/inasafe.py", line 325, in run_impact_function
    write_results(command_line_arguments, impact_layer)
  File "/home/src/inasafe/bin/inasafe.py", line 412, in write_results
    raise RuntimeError(exception.message)
RuntimeError: 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:33,121: INFO/MainProcess] Received task: headless.tasks.inasafe_wrapper.run_analysis[4f91069b-c6a9-4743-8936-70d8b5e1bbd4]  
[2016-12-22 11:39:33,244: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/4
[2016-12-22 11:39:33,379: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/55
[2016-12-22 11:39:33,673: DEBUG/PoolWorker-1] CommandLineArguments
[2016-12-22 11:39:33,679: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:33,684: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:33,685: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'startswith'
[2016-12-22 11:39:33,685: WARNING/PoolWorker-1] Attribute not found.
[2016-12-22 11:39:33,808: WARNING/PoolWorker-1] No extents
[2016-12-22 11:39:33,818: DEBUG/PoolWorker-1] createdEntire area
2016-12-22 11:39:34,022 - InaSAFE - ERROR - An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:34,062: ERROR/PoolWorker-1] Unable to reach Sentry log server: HTTP Error 502: Bad Gateway (url: http://sentry.kartoza.com/api/store/, body: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>

<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Thu, 22-Dec-16 11:40:04 GMT; path=/">

<title>sentry.kartoza.com | 502: Bad gateway</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
<div id="cf-wrapper">

    <div id="cf-error-details" class="cf-error-details-wrapper">
        <div class="cf-wrapper cf-error-overview">
            <h1>
              <span class="cf-error-type" data-translate="error">Error</span>
              <span class="cf-error-code">502</span>
              <small class="heading-ray-id">Ray ID: 31534b41c2b16385 &bull; 2016-12-22 11:39:34 UTC</small>
            </h1>
            <h2 class="cf-subheadline" data-translate="error_desc">Bad gateway</h2>
        </div><!-- /.error-overview -->

        <div class="cf-section cf-highlight cf-status-display">
            <div class="cf-wrapper">
                <div class="cf-columns cols-3">

<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-browser"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="browser_desc">You</span>
  <h3 class="cf-status-name" data-translate="browser_label">Browser</h3>
  <span class="cf-status-label" data-translate="browser_status_label">Working</span>
</div>

<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-cloud"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="cloud_desc">Frankfurt</span>
  <h3 class="cf-status-name" data-translate="cloud_label">CloudFlare</h3>
  <span class="cf-status-label" data-translate="cloud_status_label">Working</span>
</div>

<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-server"></i>
    <i class="cf-icon-status cf-icon-error"></i>
  </div>
  <span class="cf-status-desc" data-translate="server_desc">sentry.kartoza.com</span>
  <h3 class="cf-status-name" data-translate="server_label">Host</h3>
  <span class="cf-status-label" data-translate="server_status_label">Error</span>
</div>

                </div>
            </div>
        </div><!-- /.status-display -->

        <div class="cf-section cf-wrapper">
            <div class="cf-columns two">
                <div class="cf-column">
                    <h2 data-translate="what_happened">What happened?</h2>
                    <p>The web server reported a bad gateway error.</p>
                </div>

                <div class="cf-column">
                    <h2 data-translate="what_can_i_do">What can I do?</h2>
                    <p data-translate="try_again_in_a_few">Please try again in a few minutes.</p>
                </div>
            </div>
        </div><!-- /.section -->

        <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong>31534b41c2b16385</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 88.99.33.48</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
)
Traceback (most recent call last):
  File "/home/src/inasafe/safe_extras/raven/base.py", line 432, in send_remote
    self._send_remote(url=url, data=data, headers=headers)
  File "/home/src/inasafe/safe_extras/raven/base.py", line 406, in _send_remote
    return transport.send(data, headers)
  File "/home/src/inasafe/safe_extras/raven/transport/base.py", line 144, in send
    response = urllib2.urlopen(req, data, self.timeout).read()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway
[2016-12-22 11:39:34,066: ERROR/PoolWorker-1] Failed to submit message: u'An exception occurred when running the impact analysis.'
[2016-12-22 11:39:34,022: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:34,067: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:34,072: ERROR/PoolWorker-1] Task headless.tasks.inasafe_wrapper.run_analysis[4f91069b-c6a9-4743-8936-70d8b5e1bbd4] raised unexpected: RuntimeError("'NoneType' object has no attribute 'is_raster'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/src/inasafe/headless/tasks/inasafe_wrapper.py", line 84, in run_analysis
    impact_layer = run_impact_function(arguments)
  File "/home/src/inasafe/bin/inasafe.py", line 325, in run_impact_function
    write_results(command_line_arguments, impact_layer)
  File "/home/src/inasafe/bin/inasafe.py", line 412, in write_results
    raise RuntimeError(exception.message)
RuntimeError: 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:39,145: INFO/MainProcess] Received task: headless.tasks.inasafe_wrapper.run_analysis[fd735e18-7b6a-460f-b01e-1d952ad5124c]  
[2016-12-22 11:39:39,250: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/4
[2016-12-22 11:39:39,347: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/55
[2016-12-22 11:39:39,656: DEBUG/PoolWorker-1] CommandLineArguments
[2016-12-22 11:39:39,663: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:39,670: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:39,671: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'startswith'
[2016-12-22 11:39:39,671: WARNING/PoolWorker-1] Attribute not found.
[2016-12-22 11:39:39,801: WARNING/PoolWorker-1] No extents
[2016-12-22 11:39:39,816: DEBUG/PoolWorker-1] createdEntire area
2016-12-22 11:39:40,024 - InaSAFE - ERROR - An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:40,039: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
[2016-12-22 11:39:40,024: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:40,040: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:40,046: ERROR/PoolWorker-1] Task headless.tasks.inasafe_wrapper.run_analysis[fd735e18-7b6a-460f-b01e-1d952ad5124c] raised unexpected: RuntimeError("'NoneType' object has no attribute 'is_raster'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/src/inasafe/headless/tasks/inasafe_wrapper.py", line 84, in run_analysis
    impact_layer = run_impact_function(arguments)
  File "/home/src/inasafe/bin/inasafe.py", line 325, in run_impact_function
    write_results(command_line_arguments, impact_layer)
  File "/home/src/inasafe/bin/inasafe.py", line 412, in write_results
    raise RuntimeError(exception.message)
RuntimeError: 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:45,106: INFO/MainProcess] Received task: headless.tasks.inasafe_wrapper.run_analysis[6a57bb5f-0dbd-43d4-a863-8171c9c3ad80]  
[2016-12-22 11:39:45,256: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/4
[2016-12-22 11:39:45,372: INFO/PoolWorker-1] Trying to download file : http://nginx/geosafe/analysis/layer-archive/55
[2016-12-22 11:39:45,689: DEBUG/PoolWorker-1] CommandLineArguments
[2016-12-22 11:39:45,694: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:45,698: WARNING/PoolWorker-1] layer is VALID
[2016-12-22 11:39:45,699: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'startswith'
[2016-12-22 11:39:45,699: WARNING/PoolWorker-1] Attribute not found.
[2016-12-22 11:39:45,826: WARNING/PoolWorker-1] No extents
[2016-12-22 11:39:45,836: DEBUG/PoolWorker-1] createdEntire area
2016-12-22 11:39:46,013 - InaSAFE - ERROR - An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:46,052: ERROR/PoolWorker-1] Unable to reach Sentry log server: HTTP Error 502: Bad Gateway (url: http://sentry.kartoza.com/api/store/, body: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>

<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Thu, 22-Dec-16 11:40:16 GMT; path=/">

<title>sentry.kartoza.com | 502: Bad gateway</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>

</head>
<body>
<div id="cf-wrapper">

    <div id="cf-error-details" class="cf-error-details-wrapper">
        <div class="cf-wrapper cf-error-overview">
            <h1>
              <span class="cf-error-type" data-translate="error">Error</span>
              <span class="cf-error-code">502</span>
              <small class="heading-ray-id">Ray ID: 31534b8cb5436385 &bull; 2016-12-22 11:39:46 UTC</small>
            </h1>
            <h2 class="cf-subheadline" data-translate="error_desc">Bad gateway</h2>
        </div><!-- /.error-overview -->

        <div class="cf-section cf-highlight cf-status-display">
            <div class="cf-wrapper">
                <div class="cf-columns cols-3">

<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-browser"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="browser_desc">You</span>
  <h3 class="cf-status-name" data-translate="browser_label">Browser</h3>
  <span class="cf-status-label" data-translate="browser_status_label">Working</span>
</div>

<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-cloud"></i>
    <i class="cf-icon-status cf-icon-ok"></i>
  </div>
  <span class="cf-status-desc" data-translate="cloud_desc">Frankfurt</span>
  <h3 class="cf-status-name" data-translate="cloud_label">CloudFlare</h3>
  <span class="cf-status-label" data-translate="cloud_status_label">Working</span>
</div>

<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
  <div class="cf-icon-error-container">
    <i class="cf-icon cf-icon-server"></i>
    <i class="cf-icon-status cf-icon-error"></i>
  </div>
  <span class="cf-status-desc" data-translate="server_desc">sentry.kartoza.com</span>
  <h3 class="cf-status-name" data-translate="server_label">Host</h3>
  <span class="cf-status-label" data-translate="server_status_label">Error</span>
</div>

                </div>
            </div>
        </div><!-- /.status-display -->

        <div class="cf-section cf-wrapper">
            <div class="cf-columns two">
                <div class="cf-column">
                    <h2 data-translate="what_happened">What happened?</h2>
                    <p>The web server reported a bad gateway error.</p>
                </div>

                <div class="cf-column">
                    <h2 data-translate="what_can_i_do">What can I do?</h2>
                    <p data-translate="try_again_in_a_few">Please try again in a few minutes.</p>
                </div>
            </div>
        </div><!-- /.section -->

        <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">CloudFlare Ray ID: <strong>31534b8cb5436385</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 88.99.33.48</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span data-translate="performance_security_by">Performance &amp; security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
)
Traceback (most recent call last):
  File "/home/src/inasafe/safe_extras/raven/base.py", line 432, in send_remote
    self._send_remote(url=url, data=data, headers=headers)
  File "/home/src/inasafe/safe_extras/raven/base.py", line 406, in _send_remote
    return transport.send(data, headers)
  File "/home/src/inasafe/safe_extras/raven/transport/base.py", line 144, in send
    response = urllib2.urlopen(req, data, self.timeout).read()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway
[2016-12-22 11:39:46,054: ERROR/PoolWorker-1] Failed to submit message: u'An exception occurred when running the impact analysis.'
[2016-12-22 11:39:46,013: ERROR/PoolWorker-1] An exception occurred when running the impact analysis.
Traceback (most recent call last):
  File "/home/src/inasafe/safe/impact_functions/base.py", line 902, in run_analysis
    self._impact = self._calculate_impact()
  File "/home/src/inasafe/safe/impact_functions/base.py", line 1724, in _calculate_impact
    result_layer = self.run()
  File "/home/src/inasafe/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py", line 80, in run
    self.hazard_class_attribute = self.hazard.keyword('field')
  File "/home/src/inasafe/safe/impact_functions/bases/layer_types/classified_vector_hazard.py", line 28, in hazard_class_attribute
    raise NoAttributeInLayerError(message)
NoAttributeInLayerError: The attribute "flood_prone" does not exist in the hazard layer.
[2016-12-22 11:39:46,056: WARNING/PoolWorker-1] 'NoneType' object has no attribute 'is_raster'
[2016-12-22 11:39:46,062: ERROR/PoolWorker-1] Task headless.tasks.inasafe_wrapper.run_analysis[6a57bb5f-0dbd-43d4-a863-8171c9c3ad80] raised unexpected: RuntimeError("'NoneType' object has no attribute 'is_raster'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/src/inasafe/headless/tasks/inasafe_wrapper.py", line 84, in run_analysis
    impact_layer = run_impact_function(arguments)
  File "/home/src/inasafe/bin/inasafe.py", line 325, in run_impact_function
    write_results(command_line_arguments, impact_layer)
  File "/home/src/inasafe/bin/inasafe.py", line 412, in write_results
    raise RuntimeError(exception.message)
RuntimeError: 'NoneType' object has no attribute 'is_raster'

Solution

gubuntu commented 7 years ago

@NyakudyaA pls test again and comment or close

gubuntu commented 6 years ago

ping @NyakudyaA

NyakudyaA commented 6 years ago

When layers are coming from Metasearch we need to save all vector layers as geojson this will allow us to preserve the tables with their columns. In our case layers coming from oondra have a database backend and there is no limit for column length in the database and these could be the key column defined in keywords