Giter VIP home page Giter VIP logo

Comments (10)

snowskeleton avatar snowskeleton commented on June 9, 2024

I'm glad you found this useful! I knew there must be dozens of us who have this issue.

I think having Docker info in the main repo is a good idea. I'd probably take advantage of it myself. At the moment I'm focusing on other projects, but I'd love to see what you come up with.

from ynam.

snowskeleton avatar snowskeleton commented on June 9, 2024

I just got this built into a docker image here. Lemme know what you think if you have a chance to try it out.

from ynam.

natescherer avatar natescherer commented on June 9, 2024

Finally got a chance to take the docker container for a spin, but I'm also running into the issue in #20:

2022-12-01T07:08:03.627611107Z Traceback (most recent call last):

2022-12-01T07:08:03.627662780Z   File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 21, in main

2022-12-01T07:08:03.627680843Z     mints = mapi.getXtns()

2022-12-01T07:08:03.627690047Z   File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 84, in getXtns

2022-12-01T07:08:03.627698173Z     client.authorize(self.cookies(), self.key())

2022-12-01T07:08:03.627711006Z   File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 98, in cookies

2022-12-01T07:08:03.627719082Z     with open(self.cpath, 'r') as file:

2022-12-01T07:08:03.627730122Z FileNotFoundError: [Errno 2] No such file or directory: '/root/.ynam_mintapi_cookies'

2022-12-01T07:08:03.627741516Z 

2022-12-01T07:08:03.627750070Z During handling of the above exception, another exception occurred:

2022-12-01T07:08:03.627757898Z 

2022-12-01T07:08:03.627765532Z Traceback (most recent call last):

2022-12-01T07:08:03.627776205Z   File "/usr/local/bin/ynam", line 8, in <module>

2022-12-01T07:08:03.627785072Z     sys.exit(main())

2022-12-01T07:08:03.627792719Z   File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 23, in main

2022-12-01T07:08:03.627836919Z     mapi.updateAuth()

2022-12-01T07:08:03.627845714Z   File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 117, in updateAuth

2022-12-01T07:08:03.627854040Z     file.write(str(bowser._get_cookies()))

2022-12-01T07:08:03.627861814Z   File "/src/mintapi/mintapi/browser.py", line 214, in _get_cookies

2022-12-01T07:08:03.627872778Z     return self.driver.get_cookies()

2022-12-01T07:08:03.627883994Z AttributeError: 'NoneType' object has no attribute 'get_cookies'

2022-12-01T07:08:07.782375194Z Traceback (most recent call last):

2022-12-01T07:08:07.782410050Z   File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 21, in main

2022-12-01T07:08:07.782422657Z     mints = mapi.getXtns()

2022-12-01T07:08:07.782434274Z   File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 84, in getXtns

2022-12-01T07:08:07.782443005Z     client.authorize(self.cookies(), self.key())

2022-12-01T07:08:07.782450852Z   File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 99, in cookies

2022-12-01T07:08:07.782458837Z     return ast.literal_eval(file.read())

2022-12-01T07:08:07.782466543Z   File "/usr/lib/python3.8/ast.py", line 59, in literal_eval

2022-12-01T07:08:07.782474328Z     node_or_string = parse(node_or_string, mode='eval')

2022-12-01T07:08:07.782485264Z   File "/usr/lib/python3.8/ast.py", line 47, in parse

2022-12-01T07:08:07.782496717Z     return compile(source, filename, mode, flags,

2022-12-01T07:08:07.782505523Z   File "<unknown>", line 0

2022-12-01T07:08:07.782513603Z     

2022-12-01T07:08:07.782542225Z     ^

2022-12-01T07:08:07.782563158Z SyntaxError: unexpected EOF while parsing

from ynam.

natescherer avatar natescherer commented on June 9, 2024

Okay, I figured out the explanation for that, which I commented on in the other issue. However, with the container, I'm running into the same issue I am seeing when I try to run on any platform at the moment:

Traceback (most recent call last):

  File "/usr/local/bin/ynam", line 8, in <module>

    sys.exit(main())

  File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 26, in main

    ydeez = [y.import_id for y in ynapi.getXtns()]

  File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 179, in getXtns

�������
    return [

  File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 180, in <listcomp>

    YNABTransaction.from_dict(xt)

  File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 67, in from_dict

    return cls(**{

  File "<string>", line 16, in __init__

  File "/usr/local/lib/python3.8/dist-packages/ynam/api.py", line 60, in __post_init__

    self.payee_name = self.payee_name[:100]

TypeError: 'NoneType' object is not subscriptable

from ynam.

snowskeleton avatar snowskeleton commented on June 9, 2024

Can you check if the issue persists with the most recent update?

The issue you're having is usually because Mint returned bad data (often due to failure to login). I should probably add better error messages while I'm at it

from ynam.

Nick-Gatti avatar Nick-Gatti commented on June 9, 2024

As an addition to this, any chance of adding to DockerHub once the kinks are smoothed out? I'm fine doing it manually, but it'd be nice to have Unraid update for me.

from ynam.

snowskeleton avatar snowskeleton commented on June 9, 2024

@NGatti1997 there's an image in dockerhub now under snowskeleton/ynam. Lemme know how it works for you!

from ynam.

Nick-Gatti avatar Nick-Gatti commented on June 9, 2024

How is the container taking the variables? Tried adding them and got this:

Traceback (most recent call last): File "/usr/local/bin/ynam", line 5, in <module> from ynam.main import main File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 5, in <module> from .mint_api import MintAPI File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 9, in <module> from .ynab_api import YNABTransaction File "/usr/local/lib/python3.8/dist-packages/ynam/ynab_api.py", line 40, in <module> class YNABAPI(): File "/usr/local/lib/python3.8/dist-packages/ynam/ynab_api.py", line 406, in YNABAPI ) -> dict[list[YNABTransaction]]: TypeError: 'type' object is not subscriptable

Took a look at the image in DockerHub and it doesn't look like those get copied over.

from ynam.

snowskeleton avatar snowskeleton commented on June 9, 2024

I just pushed a new image. The traceback you have is from an older version, so the new one should solve your issue.

To answer your question, take a look at line 22 of ynam's Dockerfile:

ENTRYPOINT ["sudo", "ynam", "--use-chromedriver-on-path"]

The ENTRYPOINT command acts as a prefix for any commands you pass on the commandline.
For example, when you run

docker <docker arguments> run snowskeleton/ynam <some arguments>

internally docker runs

sudo ynam --user-chromedriver-on-path <some arguments>

This lets me as a developer set default arguments as well as gives the user the option to add whatever they'd like as well.

from ynam.

snowskeleton avatar snowskeleton commented on June 9, 2024

Closing as complete because a Docker container now exists for ynam. Any issues with the container should be opened as separate issues

from ynam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.