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

parse error: Invalid numeric literal at line 1, column 10 #17

Open
alexanderilyin opened this issue Dec 12, 2024 · 0 comments · May be fixed by #18
Open

parse error: Invalid numeric literal at line 1, column 10 #17

alexanderilyin opened this issue Dec 12, 2024 · 0 comments · May be fixed by #18
Assignees
Labels
bug Something isn't working

Comments

@alexanderilyin
Copy link

If you commit large text files, for example *.stl or *.step then API request to https://openrouter.ai could result in 500 and HTML instead of JSON in response:

> POST /api/v1/chat/completions HTTP/2
> Host: openrouter.ai
> user-agent: curl/7.88.1
> accept: */*
> authorization: ...
> content-type: application/json
> content-length: 86976212
...
< HTTP/2 503 
< date: Thu, 12 Dec 2024 12:36:20 GMT
< content-type: text/html; charset=UTF-8
< content-length: 4309
< x-frame-options: SAMEORIGIN
< referrer-policy: same-origin
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< server: cloudflare
< cf-ray: 8f0dc256cdba2ef3-LAX

Which is this HTML:

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
    <title>Worker exceeded resource limits | openrouter.ai | Cloudflare</title>
    <meta charset="UTF-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="robots" content="noindex, nofollow" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
    <!--[if lt IE 9]>
        <link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" />
    <![endif]-->
    <style>
        body {
            margin: 0;
            padding: 0;
        }
    </style>
    <!--[if gte IE 10]><!-->
    <script>
        if (!navigator.cookieEnabled) {
            window.addEventListener('DOMContentLoaded', function () {
                var cookieEl = document.getElementById('cookie-alert');
                cookieEl.style.display = 'block';
            });
        }
    </script>
    <!--<![endif]-->
</head>
<body>
    <div id="cf-wrapper">
        <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">
            Please enable cookies.
        </div>
        <div id="cf-error-details" class="cf-error-details-wrapper">
            <div class="cf-wrapper cf-header cf-error-overview">
                <h1>
                    <span class="cf-error-type" data-translate="error">Error</span>
                    <span class="cf-error-code">1102</span>
                    <small class="heading-ray-id">Ray ID: 8f0dba19c86e2a8e &bull; 2024-12-12 12:30:41 UTC</small>
                </h1>
                <h2 class="cf-subheadline" data-translate="error_desc">Worker exceeded resource limits</h2>
            </div>
            <!-- /.header -->
            <section></section>
            <!-- spacer -->
            <div class="cf-section cf-wrapper">
                <div class="cf-columns two">
                    <div class="cf-column">
                        <h2 data-translate="what_happened">What happened?</h2>
                        <p>
                            You've requested a page on a website
                            (<a href="https://www.cloudflare.com/5xx-error-landing/" target="_blank">Cloudflare</a>)
                            network. An unknown error occurred while rendering the page.
                        </p>
                    </div>
                    <div class="cf-column">
                        <h2 data-translate="what_can_i_do">What can I do?</h2>
                        <p>
                            <strong>If you are the owner of this website:</strong>
                            <br />
                            you should
                            <a href="https://www.cloudflare.com/login?utm_source=error_100x" target="_blank">login to
                                Cloudflare</a>
                            and check the error logs for openrouter.ai.
                        </p>
                    </div>
                </div>
            </div>
            <!-- /.section -->
            <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
                <p class="text-13">
                    <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID:
                        <strong class="font-semibold">8f0dba19c86e2a8e</strong>
                    </span>
                    <span class="cf-footer-separator sm:hidden">&bull;</span>
                    <span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
                        Your IP:
                        <button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
                        <span class="hidden" id="cf-footer-ip">104.48.82.165</span>
                        <span class="cf-footer-separator sm:hidden">&bull;</span>
                    </span>
                    <span class="cf-footer-item sm:block sm:mb-1">
                        <span>Performance &amp; security by</span>
                        <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link"
                            target="_blank">Cloudflare</a>
                    </span>
                </p>
                <script>
                    (function () {
                        function d() {
                            var b = a.getElementById("cf-footer-item-ip"),
                                c = a.getElementById("cf-footer-ip-reveal");
                            b && "classList" in b && (b.classList.remove("hidden"), c.addEventListener("click", function () {
                                c.classList.add("hidden");
                                a.getElementById("cf-footer-ip").classList.remove("hidden");
                            }));
                        }
                        var a = document;
                        document.addEventListener && a.addEventListener("DOMContentLoaded", d);
                    })();
                </script>
            </div>
            <!-- /.error-footer -->
        </div>
        <!-- /#cf-error-details -->
    </div>
    <!-- /#cf-wrapper -->
    <script>
        window._cf_translation = {};
    </script>
</body>
</html>
@alexanderilyin alexanderilyin added the bug Something isn't working label Dec 12, 2024
@alexanderilyin alexanderilyin self-assigned this Dec 12, 2024
@alexanderilyin alexanderilyin linked a pull request Dec 12, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant