Giter Club home page Giter Club logo

Comments (13)

andrewcgregory avatar andrewcgregory commented on August 11, 2024

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.

sjcallender avatar sjcallender commented on August 11, 2024

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.

johnnynotsolucky avatar johnnynotsolucky commented on August 11, 2024

@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.

andrewcgregory avatar andrewcgregory commented on August 11, 2024

@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.

nathannerdymind avatar nathannerdymind commented on August 11, 2024

@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.

johnnynotsolucky avatar johnnynotsolucky commented on August 11, 2024

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.

andrewcgregory avatar andrewcgregory commented on August 11, 2024

@johnnynotsolucky I tried this on our staging environment.

Here are the steps/results:

  1. I made sure that we received the original error when trying to sync to ShipStation first.
  2. Installed your dev branch (had to adjust it to composer require fostercommerce/shipstationconnect:dev-bugfix/country, but I think that was your intention).
  3. Tried syncing the orders to ShipStation again.
  4. Received the error "An error occurred attempting to update orders: The remote server returned an error: (500) Internal Server Error." this time.
  5. 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:
Screen Shot 2021-02-13 at 2 14 53 PM

Just to be clear, the error we receive (with this test and previously) is in ShipStation itself, not within Craft.

from shipstation-connect.

johnnynotsolucky avatar johnnynotsolucky commented on August 11, 2024

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":

$this->logException('Error processing action {action}', ['action' => $action], $e);

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.

andrewcgregory avatar andrewcgregory commented on August 11, 2024

@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:
Screen Shot 2021-02-19 at 10 18 41 AM

from shipstation-connect.

andrewcgregory avatar andrewcgregory commented on August 11, 2024

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.

johnnynotsolucky avatar johnnynotsolucky commented on August 11, 2024

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.

benface avatar benface commented on August 11, 2024

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.

aeu avatar aeu commented on August 11, 2024

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)

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.