Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Image Broken #130

Open
ky13d3nt0n opened this issue Jan 25, 2022 · 12 comments
Open

Latest Image Broken #130

ky13d3nt0n opened this issue Jan 25, 2022 · 12 comments

Comments

@ky13d3nt0n
Copy link
Contributor

ky13d3nt0n commented Jan 25, 2022

Had to reset my database and found that the latest image seems to be having troubles finding new feeders.

Was able to find an old image on Docker: https://hub.docker.com/r/tedder42/petnet-feeder-service and things are back up and running.

Checked error logs before and nothing was outputting as an issue, feeders were just never found.

@kruton
Copy link
Collaborator

kruton commented Jan 25, 2022

I've been trying to upgrade the dependencies lately. This might have broken some stuff, but it also would reveal that we don't have enough testing. Perhaps some end-to-end testing is in order.

I'll try to straighten it out in the next day or so.

@ky13d3nt0n
Copy link
Contributor Author

Got ya, no worries. Was able to get my feeders back up and working on the old image for now. But +1 on the testing for sure.

Appreciate it!

Sidenote: Is there anyway to grab a previous release of the package? https://github.com/feedernet/petnet-feeder-service/pkgs/container/petnet-feeder-service, it looks like only tagged releases here are latest. Kinda new to the GH packages.

kruton added a commit that referenced this issue Feb 5, 2022
Since it is breaking the docker container, take out the build path value
until we can fix the templating engine to work with all of the javascript
files.

Possibly related to issue #130
kruton added a commit that referenced this issue Feb 6, 2022
Since it is breaking the docker container, take out the build path value
until we can fix the templating engine to work with all of the javascript
files.

Possibly related to issue #130
@jordan-hamilton
Copy link

jordan-hamilton commented Feb 10, 2022

I noticed that a new setup (without an existing /data directory) caused 422 errors when adding a pet. Switching the Content-Type header on the /api/v1/pet POST request from text/plain to application/json resolved this for me, but it seems like all requests are text/plain and cause the same 422 error:

{"detail":[{"loc":["body"],"msg":"value` is not a valid dict","type":"type_error.dict"}]}

@ky13d3nt0n
Copy link
Contributor Author

I noticed that a new setup (without an existing /data directory) caused 422 errors when adding a pet. Switching the Content-Type header on the /api/v1/pet POST request from text/plain to application/json resolved this for me, but it seems like all requests are text/plain and cause the same 422 error:

{"detail":[{"loc":["body"],"msg":"value` is not a valid dict","type":"type_error.dict"}]}

Yep, was able to hack together some quick js to get my pets created, feeders assigned, and schedules set. What's strange is I'm able to delete pets and scheduled events through the ui, but anything to do with POST or PUT methods seem to be failing

@ky13d3nt0n
Copy link
Contributor Author

Screen Shot 2022-02-15 at 18 26 58

I saw that the application/json update was merged, but now seeing an error upon setup of feeder. Using the Manual Entry option for setting food weight sends me to a blank page. Whenever I try to do the Start weighing food option, it never seems to work.

I tried to manually register the feeder and it seems to register, but says:

 New feeders might take a few seconds to come online.

Once it has started communicating with the message broker, it will be available in the UI.

and the feeder never connects. Clicking on "Edit Feeder" also presents me with a blank page and react error.

@zoeglynn
Copy link

@ky13d3nt0n any chance you stashed your js workarounds in a form you can share?
I'm trying to set up from scratch and ran into the same blank page on the latest image, and haven't had any success with the old images at https://hub.docker.com/r/tedder42/petnet-feeder-service, either.

(Or, have you been able to identify a working image, suitable for a Pi 4?)

@kruton
Copy link
Collaborator

kruton commented Feb 23, 2022

I created a release and tagged it as '1.0.0' which should be stable. It's before I started upgrading all the backend stuff and realized our existing tests aren't covering everything.

@zoeglynn
Copy link

zoeglynn commented Feb 27, 2022

Thanks @kruton ! This is an awesome project. Pet & feeder setup worked with the 1.0.0 image, and the manual feed is working.
But scheduled feeds fail to dispense, and the logs aren't spelling out a clear difference, or anything meaningful, as far as I can tell.

Logs around successful manual feed:

petnet-feeder-service    | 2022-02-26 17:03:22,331   INFO     uvicorn.access: 172.22.0.3:52726 - "POST /api/v1/feeder/2dd6dc3e65d6f5bac896e043f653456091e96bc3/feed HTTP/1.0" 200
petnet-feeder-service    | 2022-02-26 17:03:22,343   INFO     feeder.util.mqtt.client: Unknown message: krs/cmd/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"hid": "taxbhbbofktldcuofqqpteuqyesewvtv", "name": "SendCommand", "encrypted": false, "parameters": {"deviceHid": "2dd6dc3e65d6f5bac896e043f653456091e96bc3", "command": "feed", "payload": "{\\"portion\\": 0.0625}"}}')
petnet-feeder-service    | 2022-02-26 17:03:22,657   INFO     uvicorn.access: 172.22.0.3:52728 - "GET /api/v1/feeder/ HTTP/1.0" 200
petnet-feeder-service    | 2022-02-26 17:03:22,704   INFO     uvicorn.access: 172.22.0.3:52730 - "GET /api/v1/feeder/history?size=10&page=1 HTTP/1.0" 200
petnet-feeder-service    | 2022-02-26 17:03:22,831   INFO     feeder.util.mqtt.client: Unknown message: krs/api/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"requestId": "GS-2022-02-26T17:03:22.000Z", "eventName": "GatewayToServer_ApiRequest", "encrypted": false, "parameters": {"status": "OK"}}')
petnet-feeder-service    | 2022-02-26 17:03:23,393   INFO     feeder.util.mqtt.client: Unknown message: krs/api/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"requestId": "GS-2022-02-26T17:03:23.000Z", "eventName": "GatewayToServer_ApiRequest", "encrypted": false, "parameters": {"status": "OK"}}')

Logs around scheduled feed post:

petnet-feeder-service    | 2022-02-26 17:04:42,101   INFO     feeder.util.mqtt.client: Unknown message: krs/cmd/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"hid": "teirjxmtvkgaqvahoaglxxhiybiffous", "name": "SendCommand", "encrypted": false, "parameters": {"deviceHid": "2dd6dc3e65d6f5bac896e043f653456091e96bc3", "command": "schedule", "payload": "[{\\"active\\": true, \\"automatic\\": true, \\"feeding_id\\": \\"2dd6dc3e65d6f5ba_feed1_9:06AM\\", \\"name\\": \\"FEED0\\", \\"portion\\": 1.0, \\"reminder\\": true, \\"time\\": 32760}]"}}')
petnet-feeder-service    | 2022-02-26 17:04:42,125   INFO     uvicorn.access: 172.22.0.3:52776 - "PUT /api/v1/pet/1/schedule/1 HTTP/1.0" 200
petnet-feeder-service    | 2022-02-26 17:04:42,649   INFO     feeder.util.mqtt.client: Unknown message: krs/api/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"requestId": "GS-2022-02-26T17:04:42.000Z", "eventName": "GatewayToServer_ApiRequest", "encrypted": false, "parameters": {"status": "OK"}}')
petnet-feeder-service    | 2022-02-26 17:04:42,721   INFO     uvicorn.access: 172.22.0.3:52778 - "GET /api/v1/feeder/history?size=10&page=1 HTTP/1.0" 200
petnet-feeder-service    | 2022-02-26 17:04:43,148   INFO     feeder.util.mqtt.client: Unknown message: krs/api/stg/884cc6653cf24a926cc2ee4ca2c311fd2aa5779b => bytearray(b'{"requestId": "GS-2022-02-26T17:04:42.000Z", "eventName": "GatewayToServer_ApiRequest", "encrypted": false, "parameters": {"status": "OK"}}')

There did seem to be a correlated flurry of asyncio exceptions around the time of the scheduled feed the first few times I was testing (same as mentioned in #61 (comment)) but it has not been consistent.

Any troubleshooting advice?

@ky13d3nt0n
Copy link
Contributor Author

@zoeglynn I was able to get things somewhat working with the form solution, but not everything. I ended up having to dig out one of my old sd cards with an image from maybe 8-10 months ago that is stable.

@zoeglynn
Copy link

zoeglynn commented Mar 6, 2022

thanks for the note @ky13d3nt0n. Any chance the image holds any clues about the revision it was built from? Or even the timestamp from docker inspect -f '{{ .Created }}' <image> so we could then reconstitute it?

@ky13d3nt0n
Copy link
Contributor Author

Screen Shot 2022-03-08 at 18 59 51

Looks like it's just over a year old.

I was trying to look at ways to export the image, but not sure if that's going to bundle my database and whatnot.

@kruton
Copy link
Collaborator

kruton commented May 3, 2022

I think I've fixed all the problems from the latest Bootstrap 5 upgrade with #206. I am still working on some end-to-end tests that test the Node.js frontend together with the Python backend to make sure we don't run into the same problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants