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

Blank Product/Unit #500

Open
Servinjesus1 opened this issue Sep 6, 2024 · 4 comments
Open

Blank Product/Unit #500

Servinjesus1 opened this issue Sep 6, 2024 · 4 comments

Comments

@Servinjesus1
Copy link

Does recipe import pull "Grocy stock" from actual Stock or Products tables? I suspect it should pull from the Product table - not what's actually in stock right now. That said, mine is pulling from neither.

I'm getting reasonable log messages stating that the instance is set up.

Simple recipe appears to scrape fine:

{"level":30,"time":1725658727704,"pid":31,"hostname":"1b710d5b2dd3","recipe":{"name":"Easy Hummus (Better than Store-Bought)","url":"https://www.inspiredtaste.net/15938/easy-and-smooth-hummus-recipe/","steps":"In the bowl of a food processor, combine the tahini and lemon juice and process for 1 minute. Scrape the sides and bottom of the bowl, then process for 30 seconds more. This extra time helps “whip” or “cream” the tahini, making the hummus smooth and creamy.\nAdd the olive oil, minced garlic, cumin, and a 1/2 teaspoon of salt to the whipped tahini and lemon juice. Process for 30 seconds, scrape the sides and bottom of the bowl, and then process for another 30 seconds or until well blended.\nAdd half of the chickpeas to the food processor and process for 1 minute. Scrape the sides and bottom of the bowl, then add the remaining chickpeas and process them until thick and relatively smooth, 1 to 2 minutes.\nThe hummus will likely be too thick and still have tiny bits of chickpea. To fix this, slowly add 2 to 3 tablespoons of cold water or aquafaba with the food processor turned on until you reach the perfect consistency.\nTaste and adjust as needed. Serve hummus with a drizzle of olive oil and a sprinkle of paprika, sumac, or Za’atar.\nStore homemade hummus in an airtight container and refrigerate for up to one week. Freeze, covered with a thin layer of olive oil, for up to one month.","imageUrl":"https://www.inspiredtaste.net/wp-content/uploads/2019/07/The-Best-Homemade-Hummus-Recipe-1200.jpg","servings":6},"ingredients":[{"scrapedName":"1 (15oz) can chickpeas or 1 ½ cups (250g) cooked chickpeas"},{"scrapedName":"1/4 cup (60ml) fresh lemon juice, 1 large lemon"},{"scrapedName":"1/4 cup (60ml) well-stirred tahini, try our homemade tahini recipe"},{"scrapedName":"1 small garlic clove, minced"},{"scrapedName":"2 tablespoons (30ml) extra-virgin olive oil, plus more for serving"},{"scrapedName":"1/2 teaspoon ground cumin"},{"scrapedName":"Salt to taste"},{"scrapedName":"2 to 3 tablespoons (45ml) cold water or aquafaba"},{"scrapedName":"Dash ground paprika, sumac, or Za’atar for serving"}],"msg":"Recipe added"}

but during import nothing is shown to select for product/unit.


Grocy: lscr.io/linuxserver/grocy:latest 61522391c2212c794fc8336294d6d3227fb0d7febb3eb7b597466f6931080a44
Recipe-Buddy: ghcr.io/georgegebbett/recipe-buddy:latest 8b9455aeb39a111c972d424be6791804ce08bd011275e04f405d30a2652910ab

Compose:

---
services:
  recipe-buddy:
    image: ghcr.io/georgegebbett/recipe-buddy
    container_name: grocy-recipe-buddy
    environment:
      - GROCY_API_KEY=${GROCY_API_KEY}
      - GROCY_BASE_URL=${GROCY_BASE_URL}
      - NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
      - NEXTAUTH_URL=http://localhost:3005
    ports:
      - 3005:3000
    volumes:
      - rb_data:/home/node/app/data

volumes:
  rb_data:
@flamableconcrete
Copy link

I'm getting this as well, although I'm running Grocy natively without Docker, as the latest version - 4.2.0. I checked the browser console logs and see over and over that the following two API calls keep getting logged

grocy.getQuantityUnits
grocy.getProducts

and for a more thorough message it looks like this.

TRPCClientError: [ { "code": "invalid_type", "expected": "array", "received": "object", "path": [], "message": "Expected array, received object" } ]

Hopefully that helps track this down!

@flamableconcrete
Copy link

oh, another clue that i don't know how i missed is that on the settings page it tells me right there, "Not connected to Grocy
Unable to connect to Grocy - check your URL and API key"

So what do you know - once I double checked my Recipe Buddy's Docker compose file, I had my GROCY_BASE_URL set incorrectly. I had the trailing /api/. Once I removed that, the rest of everything worked just fine!

@Servinjesus1
Copy link
Author

I am seeing the same error now, I wasn't dwelling on the settings page sufficiently long for the Not connected to Grocy error to pop up. But I can't fix it and I think I have my command (or in this case docker-compose file) configured correctly. Can someone who uses the Grocy docker chime in?

To be specific:

  • GROCY_API_KEY is a 50-character key generated on Grocy's API keys settings page
  • GROCY_BASE_URL is http://localhost:9283 i.e. the main webpage with the default port suggested by docker-grocy
  • NEXTAUTH_SECRET is a 44-character code generated by openssl rand -base64 32 and used nowhere else but to be placed here. Mine has two forward slashes, some plusses, and ends with an equal sign, of which I worried maybe were poor characters to have in this secret, but that doesn't seem to be the problem.

Have I done something wrong here?

I'm not capable enough to try hosting Grocy natively without docker. Particularly on how to spin up the repo to host it on a local port.

The database is working fine, so at least I know the plugin itself is presumably operating normally.

@Lake-e
Copy link

Lake-e commented Oct 3, 2024

@Servinjesus1 What worked for me is using the IP of the machine that is hosting it, rather than "localhost". I think in this case, localhost refers to the docker instance, rather than the machine itself.

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

3 participants