Got minus one from a read call ошибка

Most of the answers out there for this problem point to using the wrong PORT number in your connection options, or similar. In my case, after a couple hours of searching, the reason showed to be something else.

Mind which user you are using when starting Oracle listener. You should do it with the oracle user, not as root. Otherwise you end up with listener files being created as e.g. user deamon group root instead of user oracle group dba. This in turn leads to:

TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted

To check whether this is the case, go to

/var/tmp/.oracle

and list all files (ls -la). If you find out some of the s#* files being created by a root-group user, stop the listener (lsnrctl stop), delete the above files as root and restart the listener as oracle user.

Unfortunately sqldeveloper doesn’t show the full stack-trace when reading «Got minus one from a read call». I could find the problem thanks to switching to SQL-Squirrel.

The IO Error: Got minus one from a read call error is caused by the SQLNET.ora file on the database server being configured to only allow connections from certain computers on the network (as identified by their IP addresses).

Attempting to connect to a database via SQL Developer throws the error when testing or attempting to use the connection:

Screenshot-New - Select Database Connection

If the TCP.VALIDNODE_CHECKING parameter is enabled In the SQNET.ora file then the IP address of each computer allowed to connect to databases via the listener configured using that SQLNET.ora file will need to be added to the TCP.INVITED_NODES list.

Here is an example SQLNET.ora file with VALIDNODE_CHECKING enabled and one computer (with the IP address 192.168.1.101) granted access:

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES = (NTS)

tcp.validnode_checking = YES

tcp.invited_nodes = (192.168.1.101)

There is an opposite parameter to TCP.INVITED_NODES; TCP.EXCLUDED_NODES will forbid access to those IP addresses configured in its list.

With the appropriate settings in place, SQL Developer should be able to connect as planned:

Screenshot-New - Select Database Connection-1

The SQLNET.ora settings effect other systems as well as SQL Developer – tools like Oracle Enterprise Manager can also throw the Got minus one from a read call error if the OEM server is not in the list of invited nodes!

Facing the ‘Got minus one from a read call’ error in your system? This guide will help you understand the root cause behind the error and provide step-by-step solutions to resolve it.

Table of Contents

  • Introduction
  • Causes of the Error
  • Solutions
  • Solution 1: Check Network Connectivity
  • Solution 2: Disable Firewall and Antivirus
  • Solution 3: Upgrade Your Python Version
  • Solution 4: Modify Your Code
  • Solution 5: Check for Corrupted Files
  • FAQs

Introduction

The ‘Got minus one from a read call’ error typically occurs in Python-based applications when there is an issue with the network connection, particularly during data transfer or while making HTTP requests. This error can also be caused by an outdated Python version, firewall or antivirus interference, or corrupted files.

By following this guide, you will learn how to identify the cause of the error and implement the appropriate solution to resolve it.

Causes of the Error

The ‘Got minus one from a read call’ error can be attributed to the following factors:

  1. Network connectivity issues
  2. Interference from firewall or antivirus software
  3. An outdated Python version
  4. Issues within the code
  5. Corrupted files

Solutions

Solution 1: Check Network Connectivity

The first step to resolving the error is to check and ensure that your system has a stable internet connection. You can do this by:

  1. Restarting your modem or router
  2. Running a speed test to check the internet connection speed
  3. Ensuring that there are no ongoing network outages or maintenance activities from your internet service provider

If the issue persists, consider reaching out to your internet service provider for assistance.

Solution 2: Disable Firewall and Antivirus

Firewalls and antivirus software can sometimes interfere with your system’s network connection, causing the ‘Got minus one from a read call’ error. To eliminate this possibility:

  1. Temporarily disable your firewall and antivirus software
  2. Retry the operation that was causing the error
  3. If the error is resolved, consider adding your Python-based application to your firewall and antivirus exception lists

Solution 3: Upgrade Your Python Version

An outdated Python version might also be the cause of the error. To upgrade your Python version:

  1. Visit the official Python website
  2. Download the latest version of Python for your platform
  3. Install the new version and restart your system
  4. Retry the operation that was causing the error

Solution 4: Modify Your Code

In some cases, the error may be caused by issues within your code, such as incorrect handling of network connections or timeouts. To resolve this:

  1. Review your code for any network-related issues or incorrect usage of libraries
  2. Implement proper error handling and retry mechanisms for network operations
  3. Test your code to ensure the error has been resolved

Solution 5: Check for Corrupted Files

Corrupted files can also cause the ‘Got minus one from a read call’ error. To check for corrupted files:

  1. Run a system file check using a tool like System File Checker for Windows or fsck for Linux
  2. Repair any corrupted files found during the check
  3. Restart your system and retry the operation that was causing the error

FAQs

Q: What does the ‘Got minus one from a read call’ error mean?

A: This error typically occurs in Python-based applications when there is an issue with the network connection, particularly during data transfer or while making HTTP requests.

Q: Can firewalls or antivirus software cause this error?

A: Yes, firewalls and antivirus software can interfere with your system’s network connection, causing the ‘Got minus one from a read call’ error.

Q: How do I know if my Python version is causing the error?

A: You can verify the Python version installed on your system by running python --version in the command prompt. If you’re using an outdated version, consider upgrading to the latest version available on the official Python website.

Q: Can the error be caused by issues within my code?

A: Yes, the error can be caused by incorrect handling of network connections or timeouts within your code. Review your code for any network-related issues or incorrect usage of libraries.

Q: How do I check for corrupted files on my system?

A: Use a tool like System File Checker for Windows or fsck for Linux to run a system file check and repair any corrupted files found during the check.

Back to Top

Я запускаю Oracle 11GR2 на экземпляре RDS Amazon. иногда я получаю IO Error: Got minus one from a read call при вызове DriverManager.getConnection(getUrl()), и я не уверен, почему. Другие приложения работают правильно.

Чтобы еще больше запутать вещи, ошибка будет исправляться сама по себе (после следующей итерации программы).

Как мне подойти к ошибке «Получена минус одна из ошибки чтения»?

Полная трассировка стека:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java строка 44: setConn(DriverManager.getConnection(getUrl()));

Дополнительная информация:

  • Я думал, что это плохой URL-адрес JDBC, но он работает, иногда в течение нескольких дней подряд, перед сбоем.
  • Amazon RDS — управляемый экземпляр, и изменения конфигурации могут быть невозможны.
  • Я использую ojdbc6.jar для подключения

29 окт. 2013, в 14:28

Поделиться

Источник

3 ответа

Непосредственная причина проблемы заключается в том, что драйвер JDBC попытался прочитать из сетевой розетки, которая была закрыта «другим концом».

Это может быть связано с несколькими вещами:

  • Если удаленный сервер настроен (например, в файле «SQLNET.ora» ), чтобы не принимать соединения с вашего IP-адреса.

  • Если URL-адрес JDBC неверен, вы можете попытаться подключиться к тому, что не является базой данных.

  • Если слишком много открытых подключений к службе базы данных, это может отказать в новых подключениях.

Учитывая симптомы, я думаю, что сценарий «слишком много соединений» наиболее вероятен. Это говорит о том, что ваше приложение является утечкой соединений; т.е. создавать соединения, а затем не закрывать их.

Stephen C
29 окт. 2013, в 15:06

Поделиться

Мы столкнулись с той же проблемой и исправлены. Ниже приведена причина и решение.

Проблема

Когда мы создаем соединение с базой данных через механизм пула соединений, тогда сервер приложений (в нашем случае это JBOSS) создает соединение, как указано в параметре min-connection. Если у вас 10 приложений, и у каждого есть мин-соединение как 10, тогда в базе данных будет создано 100 сеансов. Также в каждой базе данных есть параметр max-session, если ваше общее соединение пересекает эту границу, чем вы получите «Получил минус один из прочитанного вызова»,
FYI: используйте нижеприведенный запрос для просмотра общей сессии

SELECT username, count(username) FROM v$session 
WHERE username IS NOT NULL group by username

Решение. С помощью нашего администратора баз данных мы увеличили таковую максимальную сессию, чтобы можно было использовать все наше приложение min-connection.

Arnab Sarkar
19 июнь 2014, в 22:54

Поделиться

Я хотел бы добавить к Стивену С ответ, мое дело было на первой точке. Поэтому, поскольку у нас есть DHCP для распределения IP-адресов в компании, DHCP изменил мой машинный адрес, не спрашивая ни меня, ни Oracle. Таким образом, из синего оракула отказался что-то сделать и дал минус одно страшное исключение. Поэтому, если вы хотите обходить это раз и навсегда, и поскольку TCP.INVITED_NODES файла SQLNET.ora не принимает подстановочные знаки, как указано здесь, вы может добавить имя хоста машины вместо IP-адреса.

Stelios Adamantidis
11 фев. 2014, в 08:44

Поделиться

Ещё вопросы

  • 0Реализация моей собственной линзы в Panda3D
  • 0показывая загрузочный образ php
  • 1Получить уровень «подписи» на Android
  • 1Virtuoso Jena Provider Construct Query Error
  • 1разобрать строку в JSON в узле JS Express
  • 0Изменить время выполнения для Automysqlbackup
  • 1Canvas Rectangle Movement On Keydown
  • 0Установка переменных в конструкторе с помощью этого
  • 1Бесконечный цикл с обновленным атрибутом внутри события изменения базовой модели
  • 1Последний раз. Ожидается ли работа с потоками?
  • 1Как правильно реализовать обработку кадров Camera2 в реальном времени с помощью RxJava?
  • 0Запретить запуск функций jQuery на определенной ширине экрана для системы меню / навигации
  • 1Проект парсера JSON [закрыт]
  • 1Получить текст XML-узла с заданным текстом соседнего узла с помощью xpath
  • 0Размещение текста над набором изображений с использованием jQuery
  • 0Не могу понять, почему SQL Query не дает мне правильный ответ
  • 1Установка пустого значения для ввода текста
  • 0Оператор indexOf IF ищет два значения в одной строке, используя &&
  • 0Chrome показывает Access Control Allow Origin ошибка
  • 1Pusher Beams — push-уведомления отписаться не работают в андроиде
  • 0заставить fadeIn и fadeOut работать гладко в jquery
  • 0Можете ли вы неявно вызвать метод, основанный на объекте
  • 0Изменение карты местоположения по умолчанию показывает
  • 0Вкладки только рендеринга первой страницы
  • 1React-родное приложение для Android, не показывающее локальные картинки / ресурсы
  • 1Bing Maps v8 — вызов события нажатия на PushPin
  • 0Различные результаты PHP между терминалом и браузером
  • 0Утверждение рейтинга звезд jquery
  • 0отправить выбранные данные в таблицу php
  • 1Как сопоставить элементы JAXB в CIM / RDF?
  • 0Значения привязки PDO не работают [дубликаты]
  • 1SmartGWT ScrollBar отсутствует при использовании SectionStack в Window
  • 0Почему моя форма активной записи теряет данные? Yii2 Framework
  • 1Ошибки Entity Framework Validation неправильно обрабатываются клиентом breeze.sharp
  • 0JQuery флажок проблемы
  • 0Как передать структуру каталога в директиву ng-file-upload в браузере Chrome?
  • 1Как связать существующее приложение Angular 2 с Nodejs Server?
  • 1Как я должен пройти через эти данные JSON?
  • 1Снимок экрана окна приложения WPF отображается на кнопке
  • 0Как создать таблицу «соединения» с информацией о двух отдельных таблицах в MySQL?
  • 0Пагинация в Yii без базы данных
  • 1Отправить письмо без аутентификации
  • 1java.lang.IllegalArgumentException: ‘значение’ не является допустимым управляемым объектом с областью
  • 0Проблема с перенаправлением страницы контактов
  • 0Извлечение Src и вставить перед HTML-ссылку с помощью JQuery
  • 1Показать документ без аутентификации
  • 1Только один элемент отображается в RecyclerView
  • 0Выберите возвращаемый пустой запрос
  • 0Маршрутизация с использованием $ stateProvider в угловых js, страница не загружается при попытке маршрутизации с использованием состояний
  • 1Передать данные в pug с помощью pug-html-loader (не может прочитать свойство undefined)

Сообщество Overcoder

Objective : Solution for ERROR :: «io error got minus one from a read call» while connecting to Oracle Database

You may face a minus one from read call error while trying to connect to database through sql developer

The root cause of this error is sqlnet.ora is not allowing any connection to oracle database due to below entry in the sqlnet.ora file

tcp.validnode_checking = Yes

tcp.invited_nodes=(r12.apps2fusion.com)

You can follow these steps to avoid the error:

1. Go to directory $ORACLE_HOME/network/admin

2. Modify sqlnet.ora file with following parameter:

tcp.validnode_checking = no

a3sqlnet with no

3. If you don’t want to disable this, you can put the machine names as follows:

tcp.invited_nodes=(machine1, machine2) (  where machine1, machine2 will be the hostname of the machine )

4. Bounce the listener (lsnrctl stop , lsnrctl start)

Once you bounce the listener , and update the sqlnet.ora file you will be able to connect to the database without any error .

Kashif Baksh

Понравилась статья? Поделить с друзьями:
  • Gorenje ws 43101 ошибка 7
  • Gorenje ws 42101 коды ошибок
  • Gorenje ws 42081 коды ошибок
  • Gorenje ws 40129 ошибка f4
  • Gorenje ws 40109 ошибка f7