Giter Club home page Giter Club logo

Comments (14)

the-mace avatar the-mace commented on July 18, 2024

Can you run that with “--verbose” that will show the raw data and where the issue is on the CLI part.

Feel free to obfuscate any PII

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

Sure thing! Thanks for taking a look and if you need any other output, just let me know.

bin/rivian_cli --vehicle_orders --verbose
\orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': [{'__typename': 'Order', 'id': '', 'orderDate': '2021-04-27T03:06:04.696Z', 'state': 'CANCELLED', 'configurationStatus': 'CONFIGURED', 'fulfillmentSummaryStatus': None, 'items': [{'__typename': 'OrderItem', 'sku': 'ACERAWM001'}, {'__typename': 'OrderItem', 'sku': 'ACERFK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERRK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERCSB001'}, {'__typename': 'OrderItem', 'sku': 'R1T'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}, {'__typename': 'Order', 'id': '', 'orderDate': '2022-04-01T22:15:04.334Z', 'state': 'ORDERED', 'configurationStatus': 'SOFT_LOCKED', 'fulfillmentSummaryStatus': 'READY_FOR_FULFILLMENT', 'items': [{'__typename': 'OrderItem', 'sku': 'R1S'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}]}}}
Vehicle Orders:
Order ID:
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
delivery:
{'data': {'delivery': None}}
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1205, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 685, in main
delivery_status = delivery(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 345, in delivery
vehicle['vin'] = response_json['data']['delivery']['vehicleVIN']
TypeError: 'NoneType' object is not subscriptable

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

Ok, you're missing the delivery data so I assume you vehicle hasn't been delivered or the status updated by Rivian yet. I've added protection for when that information is missing in commit f971b6d

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

That is correct. I am still waiting on a delivery date, but hope to have it soon. I did pull your latest change, but it's still throwing the same error. Thanks for the quick replies! :)

git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Total 5 (delta 3), reused 5 (delta 3), pack-reused 0
Unpacking objects: 100% (5/5), 1.67 KiB | 342.00 KiB/s, done.
From https://github.com/the-mace/rivian-python-api
3662cfe..f971b6d main -> origin/main
Updating 3662cfe..f971b6d
Fast-forward
src/rivian_python_api/rivian_cli.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

bin/rivian_cli --vehicle_orders --verbose
orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': [{'__typename': 'Order', 'id': '', 'orderDate': '2021-04-27T03:06:04.696Z', 'state': 'CANCELLED', 'configurationStatus': 'CONFIGURED', 'fulfillmentSummaryStatus': None, 'items': [{'__typename': 'OrderItem', 'sku': 'ACERAWM001'}, {'__typename': 'OrderItem', 'sku': 'ACERFK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERRK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERCSB001'}, {'__typename': 'OrderItem', 'sku': 'R1T'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}, {'__typename': 'Order', 'id': '', 'orderDate': '2022-04-01T22:15:04.334Z', 'state': 'ORDERED', 'configurationStatus': 'SOFT_LOCKED', 'fulfillmentSummaryStatus': 'READY_FOR_FULFILLMENT', 'items': [{'__typename': 'OrderItem', 'sku': 'R1S'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}]}}}
Vehicle Orders:
Order ID:
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
delivery:
{'data': {'delivery': None}}
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1208, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 686, in main
delivery_status = delivery(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 346, in delivery
vehicle['vin'] = response_json['data']['delivery']['vehicleVIN']
TypeError: 'NoneType' object is not subscriptable

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

Ah sorry about that was looking at the verbose output above that. Should be ok with change c846437

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

No worries. That last fix resolved the missing delivery data, but did uncover a new one.

bin/rivian_cli --vehicle_orders --verbose
orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': [{'__typename': 'Order', 'id': '', 'orderDate': '2021-04-27T03:06:04.696Z', 'state': 'CANCELLED', 'configurationStatus': 'CONFIGURED', 'fulfillmentSummaryStatus': None, 'items': [{'__typename': 'OrderItem', 'sku': 'ACERAWM001'}, {'__type name': 'OrderItem', 'sku': 'ACERFK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERRK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERCSB001'}, {'__typena me': 'OrderItem', 'sku': 'R1T'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}, {'__typename': 'Order ', 'id': '', 'orderDate': '2022-04-01T22:15:04.334Z', 'state': 'ORDERED', 'configurationStatus': 'SOFT_LOCKED', 'fulfillmentSummaryStatus': 'R EADY_FOR_FULFILLMENT', 'items': [{'__typename': 'OrderItem', 'sku': 'R1S'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFl owComplete': False}}]}}}
Vehicle Orders:
Order ID:
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
delivery:
{'data': {'delivery': None}}
Delivery appointment details: Not available yet
transaction_status:
{'errors': [{'message': 'Unauthorized request.', 'locations': [{'line': 1, 'column': 42}], 'path': ['transactionStatus'], 'extensions': {'code': 'FORBID DEN'}}], 'data': None}
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1208, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 701, in main
transaction_steps = transaction_status(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 305, in transaction_status
transaction_status = response_json['data']['transactionStatus']
TypeError: 'NoneType' object is not subscriptable

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

I see, this looks like a pre-order/deposit type. Since there's no actual order ID (unless you cleared that completely for privacy). Anyway, added more protections around missing order ID and valid transactionStatus responses in commit e9ec941

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

I do have an order number and it is displayed in the output, but I have been removing it. Probably nothing to worry about if it's out there, but I was erring on the side of caution.

The newest fix is still throwing a traceback. I know enough about Python to be dangerous, but not quite enough to provide a fix. Best I can tell, it's failing in the transaction_status function because it's not finding some expected values when it tries to process what gets passed to it.

bin/rivian_cli --vehicle_orders --verbose
orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': [{'__typename': 'Order', 'id': 'REDACTED', 'orderDate': '2021-04-27T03:06:04.696Z', 'state': 'CANCELLED', 'configurationStatus': 'CONFIGURED', 'fulfillmentSummaryStatus': None, 'items': [{'__typename': 'OrderItem', 'sku': 'ACERAWM001'}, {'__typename': 'OrderItem', 'sku': 'ACERFK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERRK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERCSB001'}, {'__typename': 'OrderItem', 'sku': 'R1T'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}, {'__typename': 'Order', 'id': 'REDACTED', 'orderDate': '2022-04-01T22:15:04.334Z', 'state': 'ORDERED', 'configurationStatus': 'SOFT_LOCKED', 'fulfillmentSummaryStatus': 'READY_FOR_FULFILLMENT', 'items': [{'__typename': 'OrderItem', 'sku': 'R1S'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}]}}}
Vehicle Orders:
Order ID: REDACTED
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
delivery:
{'data': {'delivery': None}}
Delivery appointment details: Not available yet
transaction_status:
{'errors': [{'message': 'Unauthorized request.', 'locations': [{'line': 1, 'column': 42}], 'path': ['transactionStatus'], 'extensions': {'code': 'FORBIDDEN'}}], 'data': None}
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1210, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 703, in main
transaction_steps = transaction_status(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 305, in transaction_status
if "transactionStatus" in response_json['data']:
TypeError: argument of type 'NoneType' is not iterable

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

Not a problem. Good to know if there's something in a field vs blank (so redacted or whatever is fine). Not a problem on the back and forth. I dont have a vehicle in the state and while I could (and probably should) protect all the things that's a lot of extra noise in the code vs making the "normal" cases work.

It is odd you dont have any transaction data. You're getting an "unauthorized request" answer on the transaction details. So you have an order ID but its saying unauthorized.

I've added protection again here but i'd try removing the rivian_auth.pickle file and re-logging in. Perhaps your state changed since it was first saved and only a portion of the auth needed is there.

What state are your order(s) in?

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

Commit was d1e59d5

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

I removed the rivian_auth.pickle and logged in but I'm still getting the same traceback. This is a vehicle I selected from the shop on Thursday, so I'm in the midst of the eight steps process. VIN has been assigned, but the vehicle is still in Normal according to my guide. I was hoping I could use this project to check on the status of things without having to log into my Rivian account online to look for updates. :)

bin/rivian_cli --vehicle_orders --verbose
orders:
{'data': {'orders': {'__typename': 'OrderSearch', 'data': [{'__typename': 'Order', 'id': 'REDACTED', 'orderDate': '2021-04-27T03:06:04.696Z', 'state': 'CANCELLED', 'configurationStatus': 'CONFIGURED', 'fulfillmentSummaryStatus': None, 'items': [{'__typename': 'OrderItem', 'sku': 'ACERAWM001'}, {'__typename': 'OrderItem', 'sku': 'ACERFK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERRK0001'}, {'__typename': 'OrderItem', 'sku': 'ACERCSB001'}, {'__typename': 'OrderItem', 'sku': 'R1T'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}, {'__typename': 'Order', 'id': 'REDACTED', 'orderDate': '2022-04-01T22:15:04.334Z', 'state': 'ORDERED', 'configurationStatus': 'SOFT_LOCKED', 'fulfillmentSummaryStatus': 'READY_FOR_FULFILLMENT', 'items': [{'__typename': 'OrderItem', 'sku': 'R1S'}], 'consumerStatuses': {'__typename': 'ConsumerVehicleStatuses', 'isConsumerFlowComplete': False}}]}}}
Vehicle Orders:
Order ID: REDACTED
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
delivery:
{'data': {'delivery': None}}
Delivery appointment details: Not available yet
transaction_status:
{'errors': [{'message': 'Unauthorized request.', 'locations': [{'line': 1, 'column': 42}], 'path': ['transactionStatus'], 'extensions': {'code': 'FORBIDDEN'}}], 'data': None}
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1210, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 703, in main
transaction_steps = transaction_status(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 305, in transaction_status
if response_json and 'data' in response_json and "transactionStatus" in response_json['data']:
TypeError: argument of type 'NoneType' is not iterable

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

I should have read the response better. Ok one more time on this one. Commit efe4190

from rivian-python-api.

bwilliam79 avatar bwilliam79 commented on July 18, 2024

Looks like that's the winner! Thank you so much!

bin/rivian_cli --vehicle_orders
Vehicle Orders:
Order ID: REDACTED
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
Delivery appointment details: Not available yet
0/0 Steps Complete:

Order ID: REDACTED
Order Date: 2022-04-01T22:15:04.334Z
Config State: SOFT_LOCKED
Order State: ORDERED
Status: READY_FOR_FULFILLMENT
Item: R1S
Customer flow complete: No
Delivery carrier: RIVIAN
Delivery status: INIT
Delivery appointment details: Not available yet
4/8 Steps Complete:
Step: 1: titleAndReg: COMPLETED, Complete: True
Step: 2: tradeIn: DONE_NOT_WANTED, Complete: True
Step: 3: finance: LOAN_APPROVAL_DOC_APPROVED, Complete: True
Step: 4: insurance: IN_PROGRESS_BINDING, Complete: False
Step: 5: documentUpload: DOCUMENTS_PENDING_UPLOAD, Complete: False
Step: 6: contracts: CONTRACTS_SIGNING_COMPLETE, Complete: True
Step: 7: payment: NO_PAYMENT_SUBMITTED, Complete: False
Step: 8: delivery: INIT, Complete: False

from rivian-python-api.

the-mace avatar the-mace commented on July 18, 2024

Cool

from rivian-python-api.

Related Issues (4)

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.