cschanaj commented on issue #8859: Ease switching of database engines for 
docker builds
URL: 
https://github.com/apache/incubator-superset/pull/8859#issuecomment-566846650
 
 
   @craig-rueda thanks for looking into this PR. I am getting into errors 
related to flask and python. This is strange especially when I have already 
configured the environment variable for the `postgres` docker. 
   
   
   <details><summary>Error output</summary>
   <p>
   
   
   ```
   $ curl localhost:8088
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd";>
   <html>
     <head>
       <title>AttributeError: 'NoneType' object has no attribute 'update' // 
Werkzeug Debugger</title>
       <link rel="stylesheet" 
href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"
           type="text/css">
       <!-- We need to make sure this has a favicon so that the debugger does
            not by accident trigger a request to /favicon.ico which might
            change the application state. -->
       <link rel="shortcut icon"
           href="?__debugger__=yes&amp;cmd=resource&amp;f=console.png">
       <script 
src="?__debugger__=yes&amp;cmd=resource&amp;f=jquery.js"></script>
       <script 
src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
       <script type="text/javascript">
         var TRACEBACK = 140403735151336,
             CONSOLE_MODE = false,
             EVALEX = true,
             EVALEX_TRUSTED = false,
             SECRET = "lHufyszic3QrdnL1yz9z";
       </script>
     </head>
     <body style="background-color: #fff">
       <div class="debugger">
   <h1>AttributeError</h1>
   <div class="detail">
     <p class="errormsg">AttributeError: 'NoneType' object has no attribute 
'update'</p>
   </div>
   <h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
   <div class="traceback">
   
     <ul><li><div class="frame" id="frame-140403735152344">
     <h4>File <cite 
class="filename">"/usr/local/lib/python3.6/site-packages/flask/cli.py"</cite>,
         line <em class="line">184</em>,
         in <code class="function">find_app_by_string</code></h4>
     <div class="source library"><pre class="line before"><span class="ws">     
           </span>)</pre>
   <pre class="line before"><span class="ws">        </span>else:</pre>
   <pre class="line before"><span class="ws">            </span>args = ()</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">        </span>try:</pre>
   <pre class="line current"><span class="ws">            </span>app = 
call_factory(script_info, attr, args)</pre>
   <pre class="line after"><span class="ws">        </span>except TypeError as 
e:</pre>
   <pre class="line after"><span class="ws">            </span>if not 
_called_with_wrong_args(attr):</pre>
   <pre class="line after"><span class="ws">                </span>raise</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">            </span>raise 
NoAppException(</pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152400">
     <h4>File <cite 
class="filename">"/usr/local/lib/python3.6/site-packages/flask/cli.py"</cite>,
         line <em class="line">119</em>,
         in <code class="function">call_factory</code></h4>
     <div class="source library"><pre class="line before"><span class="ws">    
</span>elif arguments:</pre>
   <pre class="line before"><span class="ws">        </span>return 
app_factory(*arguments)</pre>
   <pre class="line before"><span class="ws">    </span>elif not arguments and 
len(arg_names) == 1 and arg_defaults is None:</pre>
   <pre class="line before"><span class="ws">        </span>return 
app_factory(script_info)</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line current"><span class="ws">    </span>return 
app_factory()</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws"></span>def 
_called_with_wrong_args(factory):</pre>
   <pre class="line after"><span class="ws">    </span>&quot;&quot;&quot;Check 
whether calling a function raised a ``TypeError`` because</pre>
   <pre class="line after"><span class="ws">    </span>the call failed or 
because something in the factory raised the</pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152456">
     <h4>File <cite class="filename">"/app/superset/app.py"</cite>,
         line <em class="line">65</em>,
         in <code class="function">create_app</code></h4>
     <div class="source "><pre class="line before"><span class="ws">        
</span>return app</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">    </span># Make sure that 
bootstrap errors ALWAYS get logged</pre>
   <pre class="line before"><span class="ws">    </span>except Exception as 
ex:</pre>
   <pre class="line before"><span class="ws">        
</span>logger.exception(&quot;Failed to create app&quot;)</pre>
   <pre class="line current"><span class="ws">        </span>raise ex</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws"></span>class 
SupersetIndexView(IndexView):</pre>
   <pre class="line after"><span class="ws">    
</span>@expose(&quot;/&quot;)</pre>
   <pre class="line after"><span class="ws">    </span>def 
index(self):</pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152008">
     <h4>File <cite class="filename">"/app/superset/app.py"</cite>,
         line <em class="line">58</em>,
         in <code class="function">create_app</code></h4>
     <div class="source "><pre class="line before"><span class="ws">        
</span># Allow user to override our config completely</pre>
   <pre class="line before"><span class="ws">        </span>config_module = 
os.environ.get(&quot;SUPERSET_CONFIG&quot;, &quot;superset.config&quot;)</pre>
   <pre class="line before"><span class="ws">        
</span>app.config.from_object(config_module)</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">        </span>app_initializer = 
app.config.get(&quot;APP_INITIALIZER&quot;, SupersetAppInitializer)(app)</pre>
   <pre class="line current"><span class="ws">        
</span>app_initializer.init_app()</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">        </span>return app</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">    </span># Make sure that 
bootstrap errors ALWAYS get logged</pre>
   <pre class="line after"><span class="ws">    </span>except Exception as 
ex:</pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152120">
     <h4>File <cite class="filename">"/app/superset/app.py"</cite>,
         line <em class="line">163</em>,
         in <code class="function">init_app</code></h4>
     <div class="source "><pre class="line before"><span class="ws"></span> 
</pre>
   <pre class="line before"><span class="ws">        
</span>self.configure_middlewares()</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">        
</span>self.configure_cache()</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line current"><span class="ws">        
</span>self.configure_jinja_context()</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">        </span>with 
self.flask_app.app_context():</pre>
   <pre class="line after"><span class="ws">            
</span>self.init_app_in_ctx()</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">        
</span>self.post_init()</pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152512">
     <h4>File <cite class="filename">"/app/superset/app.py"</cite>,
         line <em class="line">207</em>,
         in <code class="function">configure_jinja_context</code></h4>
     <div class="source "><pre class="line before"><span class="ws">        
</span>appbuilder.security_manager_class = custom_sm</pre>
   <pre class="line before"><span class="ws">        
</span>appbuilder.update_perms = False</pre>
   <pre class="line before"><span class="ws">        
</span>appbuilder.init_app(self.flask_app, db.session)</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">    </span>def 
configure_jinja_context(self):</pre>
   <pre class="line current"><span class="ws">        
</span>jinja_context_manager.init_app(self.flask_app)</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">    </span>def 
configure_middlewares(self):</pre>
   <pre class="line after"><span class="ws">        </span>if 
self.config[&quot;ENABLE_CORS&quot;]:</pre>
   <pre class="line after"><span class="ws">            </span>from flask_cors 
import CORS</pre>
   <pre class="line after"><span class="ws"></span> </pre></div>
   </div>
   
   <li><div class="frame" id="frame-140403735152568">
     <h4>File <cite class="filename">"/app/superset/extensions.py"</cite>,
         line <em class="line">47</em>,
         in <code class="function">init_app</code></h4>
     <div class="source "><pre class="line before"><span class="ws">            
</span>&quot;timedelta&quot;: timedelta,</pre>
   <pre class="line before"><span class="ws">            
</span>&quot;uuid&quot;: uuid,</pre>
   <pre class="line before"><span class="ws">        </span>}</pre>
   <pre class="line before"><span class="ws"></span> </pre>
   <pre class="line before"><span class="ws">    </span>def init_app(self, 
app):</pre>
   <pre class="line current"><span class="ws">        </span>self._base_context 
= self._base_context.update(</pre>
   <pre class="line after"><span class="ws">            
</span>app.config[&quot;JINJA_CONTEXT_ADDONS&quot;]</pre>
   <pre class="line after"><span class="ws">        </span>)</pre>
   <pre class="line after"><span class="ws"></span> </pre>
   <pre class="line after"><span class="ws">    </span>@property</pre>
   <pre class="line after"><span class="ws">    </span>def 
base_context(self):</pre></div>
   </div>
   </ul>
     <blockquote>AttributeError: 'NoneType' object has no attribute 
'update'</blockquote>
   </div>
   
   <div class="plain">
     <form action="/?__debugger__=yes&amp;cmd=paste" method="post">
       <p>
         <input type="hidden" name="language" value="pytb">
         This is the Copy/Paste friendly version of the traceback.  <span
         class="pastemessage">You can also paste this traceback into
         a <a href="https://gist.github.com/";>gist</a>:
         <input type="submit" value="create paste"></span>
       </p>
       <textarea cols="50" rows="10" name="code" readonly>Traceback (most 
recent call last):
     File &quot;/usr/local/lib/python3.6/site-packages/flask/cli.py&quot;, line 
184, in find_app_by_string
       app = call_factory(script_info, attr, args)
     File &quot;/usr/local/lib/python3.6/site-packages/flask/cli.py&quot;, line 
119, in call_factory
       return app_factory()
     File &quot;/app/superset/app.py&quot;, line 65, in create_app
       raise ex
     File &quot;/app/superset/app.py&quot;, line 58, in create_app
       app_initializer.init_app()
     File &quot;/app/superset/app.py&quot;, line 163, in init_app
       self.configure_jinja_context()
     File &quot;/app/superset/app.py&quot;, line 207, in configure_jinja_context
       jinja_context_manager.init_app(self.flask_app)
     File &quot;/app/superset/extensions.py&quot;, line 47, in init_app
       self._base_context = self._base_context.update(
   AttributeError: 'NoneType' object has no attribute 'update'</textarea>
     </form>
   </div>
   <div class="explanation">
     The debugger caught an exception in your WSGI application.  You can now
     look at the traceback which led to the error.  <span class="nojavascript">
     If you enable JavaScript you can also use additional features such as code
     execution (if the evalex feature is enabled), automatic pasting of the
     exceptions and much more.</span>
   </div>
         <div class="footer">
           Brought to you by <strong class="arthur">DON'T PANIC</strong>, your
           friendly Werkzeug powered traceback interpreter.
         </div>
       </div>
   
       <div class="pin-prompt">
         <div class="inner">
           <h3>Console Locked</h3>
           <p>
             The console is locked and needs to be unlocked by entering the PIN.
             You can find the PIN printed out on the standard output of your
             shell that runs the server.
           <form>
             <p>PIN:
               <input type=text name=pin size=14>
               <input type=submit name=btn value="Confirm Pin">
           </form>
         </div>
       </div>
     </body>
   </html>
   
   <!--
   
   Traceback (most recent call last):
     File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 184, in 
find_app_by_string
       app = call_factory(script_info, attr, args)
     File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 119, in 
call_factory
       return app_factory()
     File "/app/superset/app.py", line 65, in create_app
       raise ex
     File "/app/superset/app.py", line 58, in create_app
       app_initializer.init_app()
     File "/app/superset/app.py", line 163, in init_app
       self.configure_jinja_context()
     File "/app/superset/app.py", line 207, in configure_jinja_context
       jinja_context_manager.init_app(self.flask_app)
     File "/app/superset/extensions.py", line 47, in init_app
       self._base_context = self._base_context.update(
   AttributeError: 'NoneType' object has no attribute 'update'
   
   -->
   ``` 
   
   </p>
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to