Our production system works as a cluster of Zope workers that have a ZEO server as a backend, pretty usual stuff.
As we have quite a lot of data our instances consume too much memory and we have a watchdog that restarts them whenever they go above a limit. The restarting code is basically:
bin/supervisorctl reload
Whenever that happens we get quite a lot of emails from our workers with stacktraces like (and that's the full stacktrace):
Couldn't load state for 0x052aec
Traceback (most recent call last):
File "/home/service/.buildout/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 860, in setstate
self._setstate(obj)
File "/home/service/.buildout/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 901, in _setstate
p, serial = self._storage.load(obj._p_oid, '')
AttributeError: 'NoneType' object has no attribute 'load'
I thought it was normal until I saw this question which was pointing that that could only happen to RelStorage users, and we are not using RelStorage...
Any idea on if that indicates something or we can (as we already do, although it bothers me) just automatically mark those messages from our workers as read on our mail client?
Is there any nicer/softer way to tell a Zope worker to restart? Some sort of a "finish the request you are dealing with and then restart"
Related
I'm having some troubles with the python-telegram-bot. I've been working in a local ubuntu virtual machine with no problems. I've uploaded the .py to a virtual machine on another server (24/7 running) and i run with some issues.
I'm getting this error:
telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/telegram/ext/dispatcher.py", line 555, in process_update
handler.handle_update(update, self, check, context)
File "/usr/local/lib/python3.8/dist-packages/telegram/ext/handler.py", line 198, in handle_update
return self.callback(update, context)
File "scriptbot_v7.py", line 77, in opciones
query.edit_message_text(text=info(), parse_mode='html', quote=False)
TypeError: edit_message_text() got an unexpected keyword argument 'quote'
Any ideas why quote is not working anymore? When I delete that it works, but everyone sees what someone else is saying and I preferred that doesn't happend.
The quote argument only exists for the telegram.Message.reply_* methods. It's just a shortcut for passing the correct reply_to_message_id. Because Bot/CallbackQuery.edit_message_text doesn't have a reply_to_message_id paramater, there also is no quote parameter. This is because while editing a message, you can't change whether it's a reply or not.
When I delete that it works, but everyone sees what someone else is saying and I preferred that doesn't happend.
Note that is not possible to send messages to group chats that can only be seen by some of the members. Everything posted in a group can be seen by every member of that group.
Disclaimer: I'm currently the maintainer of python-telegram-bot
I want to be notified when a file is added to "/test". So I used QFilesystemWatcher's directoryChanged signal. But when "cp aa.txt /test" I got directoryChanged signal and there when I read aa.txt I had incomplete aa.txt.
In this case how can I know the file is completed to read?
FYI, I can't use fileChanged signal since don't know exact file name.
Unfortunately, there's no way to know this in general, without some cooperation from the process that writes to the file. The writing process would need to lock the file for exclusive access, and the reading process would need to keep trying to open the file for reading until it succeeded - when the writing process has dropped the lock.
All that the directoryChanged signal tells you is what it says on the box: the directory has changed, or in this case, there's a new entry in the directory. This is completely separate from what's represented by that entry - what the contents of the file are.
The filesystem watcher is only a half of what's needed here, and this is not an issue with Qt, but with the processes. Remember that you're trying to cooperate with the writer.
As a workaround, if you have some way of validating the file contents, you can do the same while reading and validating the file: keep retrying the read, with some delay until the validation succeeds. To avoid runaway resource use, it may be worthwhile for the delays to form an exponential back-off.
When I run meteor, sometimes I get an error and it hangs on
=> Your application has errors. Waiting for file change.
I think I've let it sit before and it eventually got past that message, but it always takes a long time. What file change is it waiting for? Is it npm or meteor? And is it slow for others, or is it my Koding box being finicky? Can I just stop the process or should I wait?
I don't need help resolving the error that caused this message in this specific instance, just wondering how to handle meteor errors in general when it hangs on this message and curious as to what it means.
We have a new beta version of our software with some changes, but not around our database layer.
We've just started getting Error 3128 reported in our server logs. It seems that once it happens, it happens for as long as the app is open. The part of the code where it is most apparent is where we log data every second via SQLite. We've generated 47k errors on our server this month alone.
3128 Disk I/O error occurred. Indicates that an operation could not be completed because of a disk I/O error. This can happen if the runtime is attempting to delete a temporary file and another program (such as a virus protection application) is holding a lock on the file. This can also happen if the runtime is attempting to write data to a file and the data can't be written.
I don't know what could be causing this error. Maybe an anti-virus program? Maybe our app is getting confused and writing data on top of each other? We're using async connections.
It's causing lots of issues and we're at a loss. It has happened in our older version, but maybe 100 times in a month rather than 47,000 times. Either way I'd like to make it happen "0" times.
Possible solution: Exception Message: Some kind of disk I/O error occurred
Summary: There is probably not a problem with the database but a problem creating (or deleting) the temporary file once the database is opened. AIR may have permissions to the database, but not to create or delete files in the directory.
One answer that has worked for me is to use the PRAGMA statement to set the journal_mode value to something other than DELETE. You do this by issuing a PRAGMA statement in the same way you would issue a query statement.
PRAGMA journal_mode = OFF
Unfortunately, if the application crashes in the middle of a transaction when the OFF journaling mode is set, then the database file will very likely go corrupt.1.
1 http://www.sqlite.org/pragma.html#pragma_journal_mode
The solution was to make sure database delete, update, insert only happened one at at time by wrapping a little wrapper. On top of that, we had to watch for error 3128 and retry. I think this is because we have a trigger running that could lock the database after we inserted data.
I am currently trying to get search working in my Tridion 2011 installation. I read in another article that I should run the TcmReIndex.exe tool in the Tridion/bin folder to re-index all my sites. So I tried this and it failed with a message box giving the following details
Unable to get list of Publication items.
Unable to Intialize TDSE object.
The wait operation timed out
Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=21054; handshake=35;
The wait operation timed out
A database error occurred while executing Stored Procedure "EDA_TRUSTEES_GETTRUSTEEETOKEN"
I have four fairly large publications (100 000+ items in total) which I am trying to index.
Any ideas?
Whenever I get "Unable to Intialize TDSE object." errors, I typically write a small test script using VBScript, and try running it on the CMS server. Whilst this does not directly solve the problem, it often gives some insight into the issue by logging information in the event viewer. Try creating a test.vbs file as follows and running it:
Set tdse = CreateObject("TDS.TDSE")
tdse.initialize()
msgbox(tdse.User.Description)
Set tdse = Nothing
If it throws any errors, please let me know, and it may help us solve the problem. If it gives you a popup with your user description, then I am completely barking up the wrong tree.
I haven't come to anything conclusive but it seems like my issue may have been a temporary one as it just started working. I did increase all timeouts in Tridion MMC > Timeout Settings by 100 times their amounts but I suspect that this wasn't the issue, when it works the connection is almost instant.
If anyone else has this issue
Restart the computer the content manager is installed on, try again.
Wait an hour or two, try again.
Increase timeouts, try again.
I've run the process a few more times and it seems to be working correctly.