ODM2 / ODM2DataSharingPortal

A Python-Django web application enabling users to upload, share, and display data from their environmental monitoring sites via the app's ODM2 database. Data can either be automatically streamed from Internet of Things (IoT) devices, manually uploaded via CSV files, or manually entered into forms.
BSD 3-Clause "New" or "Revised" License
31 stars 8 forks source link

POST to monitormywatershed.org broken #682

Closed neilh10 closed 9 months ago

neilh10 commented 9 months ago

On my local test system when POSTING monitormywatershed.org I'm getting 301 It works for the same post to data.enviroDIY.org Possibly the recent upgrade https://github.com/ODM2/ODM2DataSharingPortal/releases/tag/v0.15.1

Possibly same as https://github.com/ODM2/ODM2DataSharingPortal/issues/658 Background is https://www.envirodiy.org/topic/systems-not-recognized-from-12th-v0-15-0/

I'm getting a notification on three field systems that they haven't received data for 12HRS. (I've changed sites I've visited to data.enviroDIY.org)

POST /api/data-stream/ HTTP/1.1 Host: monitormywatershed.org TOKEN: 0af40c10-cbd5-4a7d-b78c-79ca06553e54 Content-Length: 408 Content-Type: application/json

{"sampling_feature":"1e77a2de-11a7-4f4c-9237-668384eb3a18","timestamp":"2023-11-10T12:04:00-08:00","645d6ee6-c42a-4cee-9191-5a7e6a331a4c":1,"e9596fd4-35e9-4271-aab0-661aab3dd772":4.018,"d56a1272-3aa3-4675-bed5-356658bb9b0f":15.78,"9ede1bca-308d-442b-8b02-068bcb527071":0.0484,"1be5346c-c59e-47b7-ade7-d71a5e841c54":54.33,"ae401cf2-8680-4a66-9bc9-5fe78bf10713":17.28,"c0222eb2-4c63-4050-a8cf-6ae2ce68bae7":-1}

-- Response Code -- 301 waited 4277 mS Timeout 15000

ptomasula commented 9 months ago

@neilh10 thanks for reporting this. I do believe it was related to the recent upgrades that we released yesterday. I also believe is was the same issue we saw on #658, specifically in this response to that thread.

I cleared out the part of the nginx configuration redirects all traffic to HTTPS. I think I mentioned this in that previous post, but I'm now convinced that our certificate manager automatically adds that line to our nginx configuration. Our current blue/green deployment system means that on release we promote our staging server to production and then reissue the SSL certificate. I believe that cert reissue modifies the nginx specification.

I will look into if there is a way to not have this extra configuration information automatically added. I'm also going a step to our deployment checklist that verifies this configuration change (leading to the 301's) gets removed as part of our release process.

neilh10 commented 9 months ago

@ptomasula thanks so much for the quick response on Friday pm. and a holiday!! Testing it looks like it got it. Yeah hard to cover all everything with upgrades - thanks for putting it on the checklist. regards