阅读背景:

GAE本地php - Mint linux -文件存储不工作

来源:互联网 

I'm trying to get a local version of the Google app engine developer console to work with file storage. This works perfect on several windows machines. Yet when i try on a Mint linux system everything works except the file storage.

我正在尝试使用谷歌应用程序引擎开发控制台的本地版本来处理文件存储。这在一些windows机器上是完美的。然而,当我尝试使用一个Mint linux系统时,除了文件存储之外,一切都正常。

First of all i had to add following line to the php.ini:

首先,我必须在ph .ini中加入以下一行:

google_app_engine.disable_readonly_filesystem = 1

google_app_engine。disable_readonly_filesystem = 1

After that i could upload images, i would see them appear in the developer console under blobstore Viewer. Yet i could not see them in the browser.

在那之后,我可以上传图像,我会看到它们出现在blobstore查看器下的developer console中。但是我在浏览器里看不到它们。

When i dug into the logs following messages popped out.

当我仔细查看日志时,下面的消息突然出现了。

ERROR    2016-06-08 20:15:59,459 images_stub.py:438] Could not open image <open file '/tmp/appengine.app app.user/blobs/dev~app-app/n/ncoded_gs_file:cGluZ3ZhbHVlLWJ1Y2tldC1sb2NhbC9zdG9yYWdlL2ltYWdlcy91c2Vycy8xNDY1NDE2OTU3LWltZ2pwZw==', mode 'rb' at 0x7f906e2b2e40> for blob_key 'encoded_gs_file:cGluZ3ZhbHVlLWJ1Y2tldC1sb2NhbC9zdG9yYWdlL2ltYWdlcy91c2Vycy8xNDY1NDE2OTU3LWltZ2pwZw=='
Traceback (most recent call last):
  File "/home/user/Programs/google_appengine/google/appengine/api/images/images_stub.py", line 433, in _OpenBlob
    return Image.open(blob_file)
  File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1991, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file
ApplicationError(4,)
Traceback (most recent call last):
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
    self.server.gateway(self).respond()
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 272, in __call__
    return app(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/module.py", line 1489, in __call__
    return self._handle_request(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/module.py", line 865, in _handle_request
    ret = handler.handle(match, environ, wrapped_start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/wsgi_handler.py", line 60, in handle
    return self._wsgi_app(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 224, in __call__
    return self.serve_image(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 213, in serve_image
    image, mime_type = self._transform_image(blobkey, resize, crop)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 78, in _transform_image
    image = _get_images_stub()._OpenImageData(image_data)
  File "/home/user/Programs/google_appengine/google/appengine/api/images/images_stub.py", line 371, in _OpenImageData
    image = self._OpenBlob(image_data.blob_key())
  File "/home/user/Programs/google_appengine/google/appengine/api/images/images_stub.py", line 441, in _OpenBlob
    images_service_pb.ImagesServiceError.BAD_IMAGE_DATA)
ApplicationError: ApplicationError: 4 
Traceback (most recent call last):
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
    self.server.gateway(self).respond()
  File "/home/user/Programs/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 272, in __call__
    return app(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/module.py", line 1489, in __call__
    return self._handle_request(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/module.py", line 865, in _handle_request
    ret = handler.handle(match, environ, wrapped_start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/wsgi_handler.py", line 60, in handle
    return self._wsgi_app(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 224, in __call__
    return self.serve_image(environ, start_response)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 213, in serve_image
    image, mime_type = self._transform_image(blobkey, resize, crop)
  File "/home/user/Programs/google_appengine/google/appengine/tools/devappserver2/blob_image.py", line 78, in _transform_image
    image = _get_images_stub()._OpenImageData(image_data)
  File "/home/user/Programs/google_appengine/google/appengine/api/images/images_stub.py", line 371, in _OpenImageData
    image = self._OpenBlob(image_data.blob_key())
  File "/home/user/Programs/google_appengine/google/appengine/api/images/images_stub.py", line 441, in _OpenBlob
    images_service_pb.ImagesServiceError.BAD_IMAGE_DATA)

The message resolves arround bad image data. yet the devserver has no problem reading this.

该消息解决了周围的坏图像数据。然而,devserver读这篇文章没有问题。

Are there any actions i could undertake, to solve this issue ?

我能采取什么行动来解决这个问题吗?

1 个解决方案

#1


0  

This is likely an SELinux issue. Allowing a web server to write to /home/ isn't normally included in the default SELinux policy.

这可能是一个SELinux问题。允许web服务器写入/home/通常不包含在默认的SELinux策略中。

Check your logs in /var/log/messages, and /var/log/audit/audit.log. You can google for more information on turning SELinux off, or reconfiguring it to allow writing to /home/.

请检查/var/log/message和/var/log/audit/audit.log。您可以通过谷歌获取关于关闭SELinux的更多信息,或者重新配置它以允许写入/home/。


分享到: