2 Instances of Snipe are swapping data.
Please confirm you have done the following before posting your bug report:
- [ ] I have enabled debug mode
- [x] I have read checked the Common Issues page
Describe the bug I have two instances of Snipe running which are hosted at 2 different domain names (same server). I have a problem that sometimes updates on 1 instance gets written on other instance. Users have both instances logged in at the same time. Both have users imported from LDAP. I also had an issues where both instances swapped their assets, when the asset was created on 1 instance only.
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior The reason we created 2 instances is because we have separate instance for toners. We want to keep refilling history on the toners and discard them after n refills. To avoid bogging down primary instance with unused asset tags, I created separate instance. The data on both instances should remain separate at all costs.
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
- Snipe-IT Version 5.15
- OS: Windows
- Web Server: Apache
- PHP Version: 7.3 (tested with 7.2 too)
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
- Version 91
Error Messages
- WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error This does not give any error. We identified because it messed with our data.
- If a stacktrace is provided in the error, include that too.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo. NO
- Include any additional information you can find in
storage/logsand your webserver's logs. - Include the output from
php -m(this should display what modules you have enabled.)
Additional context
- Is this a fresh install or an upgrade? 1 is Fresh install and 1 instance is upgrade.
- What OS and web server you're running Snipe-IT on: Windows 8.1, Apache (WAMP)
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) install.sh
- Include what you've done so far in the installation, and if you got any error messages along the way. No errors
- Indicate whether or not you've manually edited any data directly in the database: Not yet.
Add any other context about the problem here.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
That's definitely a configuration issue on your end. There is nothing on our end that would cause that.
Have you ever come across something similar?
Never, I'm afraid. The only thing I can think of is that your .env is being cached weird, or there is the wrong database info in one of them, but there's nothing we have in our system that would even facilitate that if it was a desired effect.
So, I had 2 instances. 1 was running at assets.it.subdomain.com and other was assets2.it.subdomain2.com. I have disabled Full Multi Companies support and the issue seem to have stopped for now. The real issue started with I setup another instance with asset.acc.subdomain.com. When I imported data into assets.acc both instances for IT assets went blank. I had to restart sql and apache for it to populate with data. I finally remaned assets.acc to accassets.subdomain.local and now everything is working properly. I think this is problem with cookies or something. Anyhow, just throwing this out there for anyone with similar problems.
Thanks so much for the follow up. I’m glad you’re sorted. I’ll close this for now. :)
UPDATE:
I was having issues even after multi companies support disabled. Issue was this: if we have both instances open on the same browser, sometime any update made in Instance1 would apprear in Instance2 and vice versa. While migrating Instance2 to another domain, I realised that .env file have same settings for both Instances
Under optional settings:
COOKIE_NAME=snipeit_session
Under cache settings:
CACHE_PREFIX=snipeit
I have changed this for both instances and now hopefully I should not face the similar issue again.
That would make sense, if they're on the same domain.