Comments (13)
We saw this same issue. We were able to put a temporary fix in place (see #19 for the fix for updating the services/Xml.php
to hardcode the country code to US). We have not yet identified what is causing the issue as our site only allows orders for the US and we have not found any order data that is incorrect.
from shipstation-connect.
Hey @nathannerdymind and @andrewcgregory, thanks for pointing this out. Somehow it slipped by our radar. We'll review and get back to you.
from shipstation-connect.
@nathannerdymind @andrewcgregory could you show us what an order with test data looks like which causes this error? Specifically the billing address and the shipping address.
from shipstation-connect.
@johnnynotsolucky I'm actually not sure what order is causing the issue. When it first showed up there was a large number of new orders in this store. We had checked through the order data and were not able to find any that stood out with abnormal billing or shipping info. Any recommendations on a way to find what order is actually triggering the issue?
from shipstation-connect.
@johnnynotsolucky We have the same temporary fix in place #19 . It was on every order with test shipping address info like:
Shipping Address
Nerdy Mind
Testing street
80521 Fort Collins
United States
Colorado
0000000000
from shipstation-connect.
I've created a branch to try help debug.
If you could install the bugfix/address
branch of the plugin and run the export again on your test install that would be great!
composer require fostercommerce/shipstationconnect:dev-bugfix/address
When there's an error it'll just spit out a JSON object with the order ID and its shipping and billing info. The address data should include the countryIso
property.
from shipstation-connect.
@johnnynotsolucky I tried this on our staging environment.
Here are the steps/results:
- I made sure that we received the original error when trying to sync to ShipStation first.
- Installed your dev branch (had to adjust it to
composer require fostercommerce/shipstationconnect:dev-bugfix/country
, but I think that was your intention). - Tried syncing the orders to ShipStation again.
- Received the error "An error occurred attempting to update orders: The remote server returned an error: (500) Internal Server Error." this time.
- I then re-installed v1.3.5 of shipstationconnect and tested and received the original "An error occurred attempting to update orders: Error in XML. Reason: The 'Country' element is invalid - The value '' is invalid according to its datatype 'StringExactly2' - The actual length is less than the MinLength value." error again.
Here is a screenshot of the error from within ShipStation:
Just to be clear, the error we receive (with this test and previously) is in ShipStation itself, not within Craft.
from shipstation-connect.
Apologies @andrewcgregory, I thought you were testing the export locally by calling the endpoint directly. On your staging environment the error log should be available in your logs.
You can search for "Error processing action":
Just to be clear, the error we receive (with this test and previously) is in ShipStation itself, not within Craft.
Got it. It seems that for some reason the country ISO isn't being sent to ShipStation from the plugin. I'm not sure why that is, and I'm hoping the log data will point us in the right direction to resolve this.
from shipstation-connect.
@johnnynotsolucky No problem. I pulled the logs and was able to find this error. I don't want to share all of the logs here, but I cleared out the personal info and I'll share what I can below. I can send you a link to full copy through an email or DM if you're in the Craft Discord channel if needed.
Partial log:
error-log.txt
Address looks fine in the control panel:
from shipstation-connect.
I did some more digging into the actual database tables today and it looks like we had one old customer that somehow did have addresses with a countryId = null
and when they placed a recent order that pulled in this address it caused the syncing issue. We were able to get this address updated to include the country as it should have previously, and everything appears to be working correctly.
from shipstation-connect.
Thank you for the logs @andrewcgregory. @nathannerdymind were you able to confirm whether the country is not set on some orders?
You can use this query to see which orders don't have a country set in either shipping or billing address:
SELECT
orders.id
FROM commerce_orders orders
JOIN commerce_addresses shippingAddresses ON orders.shippingAddressId = shippingAddresses.id
JOIN commerce_addresses billingAddresses ON orders.billingAddressId = billingAddresses.id
WHERE (
shippingAddresses.countryId IS NULL
OR billingAddresses.countryId IS NULL
)
;
We have an internal task to overhaul the code which validates orders and generates the XML for ShipStation. Part of that work would be to include better validation on the data so that these errors can be caught and easily resolved without much hassle.
from shipstation-connect.
Closing for inactivity. @nathannerdymind, feel free to reopen if you are still experiencing this issue after checking that you donβt have any order where countryId = null
.
from shipstation-connect.
We are getting this same error, but in our case it is happening with orders that don't have an address at all.
from shipstation-connect.
Related Issues (20)
- Invalid Discount price when >= $1000 HOT 1
- Unable to connect to the marketplace! Error: Invalid XML HOT 2
- Failing. XML is invalid. User fields hidden. HOT 1
- Question: Shipping Providers/Prices HOT 1
- Shipped Status for GLS HOT 7
- Push historic orders to shipstation HOT 3
- Orders not passing to Shipstation HOT 5
- Error with orders that have no address HOT 8
- ?action=export not returning all orders HOT 7
- Exported orders should respect XML Schema for Validating Order Information
- Craft 4? HOT 8
- Orders recalculated after Shipstation update? HOT 11
- Exclude Adjustments from XML HOT 5
- Cant get orders to show up in ship station HOT 1
- FR: ability to set phone for addresses HOT 1
- Does XML Pagination Affect Import? HOT 5
- No shipping info coming through shipstation connect. HOT 5
- Getting 403 connecting to Custom Store on Laravel Forge HOT 7
- Processing Short Numbers Only? HOT 2
- Craft 5 Compatibility HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shipstation-connect.