building-envelope-data / database

Reference implementation of a product data server as part of the product data network buildingenvelopedata.org
MIT License
0 stars 0 forks source link

Update resource of optical data set #61

Open christoph-maurer opened 1 week ago

christoph-maurer commented 1 week ago

When I try update the optical data set e068d8f9-9e2c-4695-b5fc-16992041040f , I enter the access token and this UUID. But when I get the resource with the locator https://www.solarbuildingenvelopes.com/api/resources/9942026b-b9a2-4b4e-b9a0-5ba64f5a2eef , I still get the old file, even with google inspector and network cache disabled.

The log on the server looks good, too:

backend-1   | [08:47:03 INF] HTTP POST /api/upload-file responded 400 in 108.5860 ms
nginx-1     | 172.18.0.1 - - [04/Jul/2024:08:47:03 +0000] "POST /api/upload-file?getHttpsResourceUuid=e068d8f9-9e2c-4695-b5fc-16992041040f HTTP/1.0" 400 107 "https://www.solarbuildingenvelopes.com/upload-file" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "109.192.195.202"
backend-1   | [08:47:16 INF] HTTP GET /health responded 200 in 9.4049 ms
simon-wacker commented 1 week ago

Well, no, the logs do not look good. It says that .../upload-file responded with status code 400, which means bad request, see for example https://http-status-code.de/400/ So, the upload doesn't work in the first place and that is why you get the old file. Now I need to figure out why the upload fails.

christoph-maurer commented 1 week ago

Thank you, @simon-wacker !

I have created the new optical data set 69ac98fb-3eb5-42d6-842f-ce1b4b314a05 . e068d8f9-9e2c-4695-b5fc-16992041040f already has a resource, 69ac98fb-3eb5-42d6-842f-ce1b4b314a05 not yet. When I try to upload the resource, I receive the following log:

backend-1   | [13:59:23 INF] HTTP GET /health responded 200 in 7.3926 ms
nginx-1     | 2024/07/04 13:59:31 [error] 33#33: *38403 open() "/data/files/4efd23f5-5b93-45dd-be17-e140a934c287" failed (2: No such file or directory), client: 172.18.0.1, server: , request: "GET /api/resources/4efd23f5-5b93-45dd-be17-e140a934c287 HTTP/1.0", host: "www.solarbuildingenvelopes.com", referrer: "https://www.solarbuildingenvelopes.com/data/optical"
nginx-1     | 172.18.0.1 - - [04/Jul/2024:13:59:31 +0000] "GET /api/resources/4efd23f5-5b93-45dd-be17-e140a934c287 HTTP/1.0" 404 548 "https://www.solarbuildingenvelopes.com/data/optical" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "109.192.195.202"
nginx-1     | 2024/07/04 13:59:38 [error] 33#33: *38404 open() "/data/files/4efd23f5-5b93-45dd-be17-e140a934c287" failed (2: No such file or directory), client: 172.18.0.1, server: , request: "GET /api/resources/4efd23f5-5b93-45dd-be17-e140a934c287 HTTP/1.0", host: "www.solarbuildingenvelopes.com", referrer: "https://www.solarbuildingenvelopes.com/data/optical"
nginx-1     | 172.18.0.1 - - [04/Jul/2024:13:59:38 +0000] "GET /api/resources/4efd23f5-5b93-45dd-be17-e140a934c287 HTTP/1.0" 404 548 "https://www.solarbuildingenvelopes.com/data/optical" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "109.192.195.202"
backend-1   | [13:59:53 INF] HTTP GET /health responded 200 in 8.0567 ms