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

Issue while trying to create an application resource #44

Open
juliopovedacs opened this issue Feb 29, 2020 · 7 comments
Open

Issue while trying to create an application resource #44

juliopovedacs opened this issue Feb 29, 2020 · 7 comments

Comments

@juliopovedacs
Copy link

juliopovedacs commented Feb 29, 2020

Hello.

I am following the Quick Start tutorial: https://www.openmtc.org/doc.html

After cloning the repository, building the gateway image, and running it, I am facing issues. When I try to create an application resource (by running the corresponding command that appears in the Quick Start tutorial), the following message appears on my terminal window:

"Failed to connect to localhost port 8000: Connection refused".

I opened Docker Desktop's dashboard to check the gateway container log, and I found the following:

ERROR

Can someone help me please?

Thank you.

@mKay00
Copy link

mKay00 commented Mar 1, 2020

I have a related issue. I am trying to run the minimal application from https://fiware-openmtc.readthedocs.io/en/latest/sdk-framework/index.html and when I run it, I get the same ImportError of 'Accept' as you in the same file.

Traceback (most recent call last):
  File "client.py", line 1, in <module>
    from openmtc_app.onem2m import XAE
  File "/usr/local/lib/python3.5/dist-packages/openmtc_app/onem2m.py", line 28, in <module>
    from openmtc_app.notification import NotificationManager
  File "/usr/local/lib/python3.5/dist-packages/openmtc_app/notification/__init__.py", line 11, in <module>
    from openmtc_onem2m.serializer import get_onem2m_decoder
  File "/usr/local/lib/python3.5/dist-packages/openmtc_onem2m/serializer/__init__.py", line 3, in <module>
    from werkzeug import Accept, parse_accept_header
ImportError: cannot import name 'Accept'

My guess is that there is a version incompatibility, but I am not sure. I am going to try different versions tomorrow, maybe I find a working one.
Currently, I am using:

  • Python 3.5.3
  • werkzeug 1.0.0
  • openMTC latest master

@CodeOne91
Copy link

I solved the same problem using werkzeug 0.16.
Worked for me.

@juliopovedacs
Copy link
Author

Hello.

Thanks @mKay00 and @CodeOne91 for your comments.

@CodeOne91 how can I downgrade werkzeug please? I execute pip3 freeze in my terminal window and werkzeug does not even appear.

Thank you for your help.

@juliopovedacs
Copy link
Author

juliopovedacs commented Mar 6, 2020

I found there is a dependencies.txt file inside openmtc-gevent, and it has the following line: werkzeug>=0.9.

So, I changed it to werkzeug==0.16, saved the file, deleted the previous gateway image I had built and created a new gateway image (with the ./create-binary-docker gateway command).

However, I still get the "Failed to connect to localhost port 8000: Connection refused" when I try to create an application resource.

I checked my terminal window and my change to the werkzeug version was ignored.

Can someone help me please?

Thank you.

@juliopovedacs
Copy link
Author

juliopovedacs commented Mar 6, 2020

Hello.

I was able to downgrade werkzeug to version 0.16 as @CodeOne91 said by editing the following files:

  1. openmtc-gevent/dependencies.txt
    Changed line 9: werkzeug==0.16
  2. setup-sdk.py
    Changed line 21: "urllib3", "gevent (>=1.0)", "iso8601 (>=0.1.5)", "werkzeug (==0.16)",
    Changed line 26: "urllib3", "gevent >= 1.0", "iso8601 >= 0.1.5", "werkzeug == 0.16",
  3. setup-gevent-all.py
    Changed line 27: "urllib3", "gevent (>=1.0)", "iso8601 (>=0.1.5)", "werkzeug (==0.16)",
    Changed line 35: "urllib3", "gevent >= 1.0", "iso8601 >= 0.1.5", "werkzeug == 0.16",

With these changes, deleting previous built gateway image and building a new gateway image, OpenMTC works again.

@CodeOne91
Copy link

@japoveda10 sorry for being late. You can try this command in future:
sudo -H pip3 install Werkzeug==0.16.0
python version 3.5

@juliopovedacs
Copy link
Author

No worries. Thank you @CodeOne91!

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