Problem with using openresty nginx luajit
まだ誰も着手していません。
評価
調査の方向性
Start by comparing the OpenResty LuaJIT setup and the standalone LuaJIT setup in the Dockerfile, then check how lua-vips loads operations in vips/voperation.lua around line 230. The report provides no failing test or confirmed cause; reproduce both the text and JPEG load failures in the supplied container setup. Done means identifying the cause and showing the example operations work under OpenResty.
索引モデルが issue の本文から書いたものです。
説明
Hello, I'm trying to run hello world example in nginx configuration
location = /lua {
content_by_lua '
local vips = require "vips"
local image1 = vips.Image.text("Hello <i>World!</i>", { dpi = 300 })
print("writing to x.png ...")
image1:write_to_file("x.png")
';
}
My Dockerfile
FROM openresty/openresty:alpine
RUN adduser -D -H -s /sbin/nologin nginx
RUN apk add --no-cache wget luarocks gd-dev vips-dev vips-tools make pango-dev
RUN curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-3.9.2.tar.gz -o luarocks-3.9.2.tar.gz \
&& tar xzf luarocks-3.9.2.tar.gz \
&& cd luarocks-3.9.2 \
&& ./configure \
--prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit \
--lua-suffix=jit-2.1.0-beta3 \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
&& make build \
&& make install \
&& rm -rf luarocks-3.9.2 luarocks-3.9.2.tar.gz
RUN luarocks install lua-vips
COPY ./docker/nginx/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY ./docker/nginx/conf.d/ /usr/local/openresty/nginx/conf/conf.d
COPY ./docker/nginx/test-upload.jpeg /
When I run the code it gives an error:
2024/02/27 06:52:12 [error] 9#9: *4 lua entry thread aborted: runtime error: ...local/openresty/luajit/share/lua/5.1/vips/voperation.lua:230: unable to call text
stack traceback:
coroutine 0:
[C]: in function 'error'
...local/openresty/luajit/share/lua/5.1/vips/voperation.lua:230: in function 'text'
content_by_lua(nginx.conf:176):7: in main chunk, client: 172.21.0.1, server: , request: "GET /lua HTTP/1.1", host: "localhost:56442"
When i try to use jpeg file i'll get another error:
/ # luajit
LuaJIT 2.1.ROLLING -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/
JIT: ON fold cse dce fwd dse narrow loop abc sink fuse
> vips = require 'vips'
> base = vips.Image.new_from_file("test-upload.jpeg")
...local/openresty/luajit/share/lua/5.1/vips/voperation.lua:230: unable to call VipsForeignLoadJpegFile
stack traceback:
[C]: in function 'error'
...local/openresty/luajit/share/lua/5.1/vips/voperation.lua:230: in function 'new_from_file'
stdin:1: in main chunk
[C]: at 0xaaaae7978c04
Vips config
/ # vips --vips-config
enable debug: false
enable deprecated: true
enable modules: true
enable cplusplus: true
enable RAD load/save: true
enable Analyze7 load/save: true
enable PPM load/save: true
enable GIF load: true
use fftw for FFTs: true
SIMD support with highway: true
accelerate loops with ORC: false
ICC profile support with lcms: true
zlib: true
text rendering with pangocairo: true
font file support with fontconfig: true
EXIF metadata support with libexif: true
JPEG load/save with libjpeg: true
JXL load/save with libjxl: true (dynamic module: true)
JPEG2000 load/save with OpenJPEG: true
PNG load/save with libspng: true
PNG load/save with libpng: false
selected quantisation package: imagequant
TIFF load/save with libtiff: true
image pyramid save with libarchive: false
HEIC/AVIF load/save with libheif: true (dynamic module: true)
WebP load/save with libwebp: true
PDF load with PDFium: false
PDF load with poppler-glib: true (dynamic module: true)
SVG load with librsvg: true
EXR load with OpenEXR: true
OpenSlide load: false (dynamic module: false)
Matlab load with libmatio: false
NIfTI load/save with niftiio: false
FITS load/save with cfitsio: true
GIF save with cgif: true
selected Magick package: MagickCore (dynamic module: true)
Magick API version: magick7
Magick load: true
Magick save: true
Vips version
/ # vips -v
vips-8.15.0
I'll run it in docker on macbook m1.
Maybe I forgot to configure something?
The problem looks similar to the one described here https://github.com/libvips/lua-vips/issues/49
Any help would be appreciated, thanks.
- 主要言語
- Lua
- スター
- 151
- フォーク
- 10
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libvips/lua-vips のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 32/100
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
libvips/lua-vips の issue をすべて見る
似ている issue
-
follow-up needs-review
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ksysoev/duet.nvim#310 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Jaliborc/PetTracker#509 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
bug discord triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fitzforge/polestar#5203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信