Image issue on production : "url" parameter is valid but upstream response is invalid #56935
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Image (next/image)
Related to Next.js Image Optimization.
locked
Link to the code that reproduces this issue
https://github.com/mcasters/coucou.git
To Reproduce
<Image src="/n.jpg" alt="image" width={180} height={230} />
`
const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');
const port = parseInt(process.env.PORT || '3000', 10)
const hostname = 'localhost'
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev, hostname, port })
const handle = app.getRequestHandler()
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
}).listen(port)
})
`
"scripts": { "dev": "NODE_ENV=development node server.js", "build": "next build", "start": "cross-env NODE_ENV=production node dist/server.js", "lint": "next lint" },
Current vs. Expected behavior
The home page should display the new image next to the logo, but only the logo is displayed.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Tue Aug 9 14:38:15 UTC 2022 Binaries: Node: 18.16.1 npm: 9.5.1 Yarn: N/A pnpm: N/A Relevant Packages: next: 13.5.6-canary.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
I open this issue since #53715 is closed and next@13.5.5 didn't solve my problem. I also tried v13.5.6-canary.1
Only svg images are displayed, but jpeg, jpg, png, webp throw TypeError: fetch failed.
Https or http doesn't change anything.
Log from server :
server.log
Log from client :
"url" parameter is valid but upstream response is invalid
Network :
Résumé
URL: http://xxxxxx.fr/_next/image?url=%2Fn.jpg&w=256&q=75
État: 500 Internal Server Error
Source: Réseau
Adresse: 109.234.162.107:80
Initiateur:
xxxxxx.fr:1
Requête
GET /_next/image HTTP/1.1
Accept: image/webp,image/avif,image/jxl,image/heic,image/heic-sequence,video/;q=0.8,image/png,image/svg+xml,image/;q=0.8,/;q=0.5
Accept-Encoding: gzip, deflate
Accept-Language: fr-FR,fr;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Host: xxxxxx.fr
Pragma: no-cache
Referer: http://xxxxxx.fr/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
Réponse
HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Date: Tue, 17 Oct 2023 13:00:13 GMT
Server: o2switch-PowerBoost-v3
Status: 500 Internal Server Error
Transfer-Encoding: Identity
X-Powered-By: Phusion Passenger(R) 6.0.18
Paramètres de chaîne de requête
url: /n.jpg
w: 256
q: 75
Maybe relevant : the image has "txt" type and its name (n.jpeg) is not entered :
The text was updated successfully, but these errors were encountered: